← Back to PRs

#2716: Fix #2678: markdown horizontal rules not rendering in web chat

by Ambar-13 open 2026-01-27 10:15 View on GitHub →
app: web-ui size: XS
Fix #2678 markdown horizontal rule rendering in web chat Ensure --- / *** / ___ are recognized as thematic breaks and add regression test. <!-- greptile_comment --> <h2>Greptile Overview</h2> <h3>Greptile Summary</h3> This PR attempts to fix missing markdown thematic breaks in the web chat UI by preprocessing message markdown in `ui/src/ui/chat/grouped-render.ts` (wrapping exact `---` / `***` / `___` lines with newlines before calling `toSanitizedMarkdownHtml`). It also adds a regression test in `ui/src/ui/markdown.test.ts` asserting that `toSanitizedMarkdownHtml` can produce an `<hr>` for an input containing `---`. The change sits at the UI rendering layer (Lit templates) and feeds into the shared markdown sanitizer/renderer (`ui/src/ui/markdown.ts`, which uses `marked` + DOMPurify). <h3>Confidence Score: 3/5</h3> - Likely safe to merge, but may not fully fix the reported rendering bug in all real-world cases. - Changes are small and localized, but the newline-padding logic is narrowly scoped (exact matches only) and the added test doesn’t exercise the actual UI preprocessing path, so there’s a meaningful chance the reported issue persists for common inputs/variants. - ui/src/ui/chat/grouped-render.ts (thematic break preprocessing) and ui/src/ui/markdown.test.ts (test coverage for variants/UI path) <!-- greptile_other_comments_section --> <sub>(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!</sub> **Context used:** - Context from `dashboard` - CLAUDE.md ([source](https://app.greptile.com/review/custom-context?memory=fd949e91-5c3a-4ab5-90a1-cbe184fd6ce8)) - Context from `dashboard` - AGENTS.md ([source](https://app.greptile.com/review/custom-context?memory=0d0c8278-ef8e-4d6c-ab21-f5527e322f13)) <!-- /greptile_comment -->

Most Similar PRs