feat(messages): render bodies as markdown with syntax-highlighted code #73

Merged
nrupard merged 1 commit from feat/markdown-rendering into main 2026-05-11 20:30:11 +02:00
Owner

Message bodies are now parsed as CommonMark with strikethrough, tables, and task list extensions, then rendered through pulldown_cmark. Fenced code blocks are syntax-highlighted server-side via syntect (default-fancy feature, no oniguruma) and emit inline-styled

 blocks so no separate stylesheet ships with them.

The existing chat pipeline (mention chips, custom emoji shortcodes, bare-URL linkification) runs on inline text events only, so it never touches the contents of fenced code blocks or inline code spans. Raw HTML and inline HTML events are dropped from the parse stream so user input cannot smuggle markup. Soft breaks become hard breaks because chat users expect typed newlines to render as line breaks.

The message and thread-reply templates swap whitespace-pre-wrap for an lc-md class. main.css gains minimal typography rules for paragraphs, lists, blockquotes, headings, tables, inline code, and code blocks, scoped to .lc-md so the rest of the app is unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) noreply@anthropic.com

Message bodies are now parsed as CommonMark with strikethrough, tables, and task list extensions, then rendered through pulldown_cmark. Fenced code blocks are syntax-highlighted server-side via syntect (default-fancy feature, no oniguruma) and emit inline-styled <pre> blocks so no separate stylesheet ships with them. The existing chat pipeline (mention chips, custom emoji shortcodes, bare-URL linkification) runs on inline text events only, so it never touches the contents of fenced code blocks or inline `code` spans. Raw HTML and inline HTML events are dropped from the parse stream so user input cannot smuggle markup. Soft breaks become hard breaks because chat users expect typed newlines to render as line breaks. The message and thread-reply templates swap `whitespace-pre-wrap` for an `lc-md` class. main.css gains minimal typography rules for paragraphs, lists, blockquotes, headings, tables, inline code, and code blocks, scoped to `.lc-md` so the rest of the app is unaffected. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
feat(messages): render bodies as markdown with syntax-highlighted code
Some checks failed
Check / clippy + fmt + tests (pull_request) Failing after 49s
289d86ad7e
Message bodies are now parsed as CommonMark with strikethrough, tables, and task list extensions, then rendered through pulldown_cmark. Fenced code blocks are syntax-highlighted server-side via syntect (default-fancy feature, no oniguruma) and emit inline-styled <pre> blocks so no separate stylesheet ships with them.

The existing chat pipeline (mention chips, custom emoji shortcodes, bare-URL linkification) runs on inline text events only, so it never touches the contents of fenced code blocks or inline `code` spans. Raw HTML and inline HTML events are dropped from the parse stream so user input cannot smuggle markup. Soft breaks become hard breaks because chat users expect typed newlines to render as line breaks.

The message and thread-reply templates swap `whitespace-pre-wrap` for an `lc-md` class. main.css gains minimal typography rules for paragraphs, lists, blockquotes, headings, tables, inline code, and code blocks, scoped to `.lc-md` so the rest of the app is unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
nrupard deleted branch feat/markdown-rendering 2026-05-11 20:30:11 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/lets-chat!73
No description provided.