Skip to content

feat: Parse inline markdown in session history assistant turns#41

Open
torarnv wants to merge 1 commit intolangwatch:mainfrom
torarnv:parse-inline-markdown-in-session-history
Open

feat: Parse inline markdown in session history assistant turns#41
torarnv wants to merge 1 commit intolangwatch:mainfrom
torarnv:parse-inline-markdown-in-session-history

Conversation

@torarnv
Copy link
Contributor

@torarnv torarnv commented Mar 9, 2026

Summary

  • Parse inline markdown (**bold**, *italic*, `code`, [links](url), ~~strikethrough~~) in assistant text blocks using AttributedString(markdown:) with .inlineOnlyPreservingWhitespace
  • Style inline code spans with a subtle background color to distinguish them in the monospace font
  • Update search highlighting and URL detection to use offset-based index mapping, since markdown parsing strips syntax characters

Test plan

  • Open session history with an assistant turn containing **bold**, *italic*, and `code` — verify they render with proper styling
  • Search for text that spans across or within markdown-formatted content — verify highlighting works
  • Cmd+hover over bare URLs in assistant text — verify they remain clickable
  • Verify user turns and tool use/result lines are unaffected (no markdown parsing)

Assistant text blocks were rendered as plain text, so markdown syntax
like **bold**, *italic*, and `code` showed up literally. We now parse
inline markdown via AttributedString(markdown:) with
inlineOnlyPreservingWhitespace, which handles bold, italic, code
spans, links, and strikethrough while preserving the whitespace layout.

Inline code spans get a subtle background to distinguish them even in
the monospace font. Search highlighting and URL detection were updated
to use offset-based index mapping, since markdown parsing strips syntax
characters and the old direct index mapping would be off.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant