Skip to content

fix(desktop): preserve angle brackets in inline code - #5816

Open
ndizazzo wants to merge 1 commit into
block:mainfrom
ndizazzo:ndizazzo/special-characters-in-code-blocks
Open

fix(desktop): preserve angle brackets in inline code#5816
ndizazzo wants to merge 1 commit into
block:mainfrom
ndizazzo:ndizazzo/special-characters-in-code-blocks

Conversation

@ndizazzo

@ndizazzo ndizazzo commented Aug 13, 2026

Copy link
Copy Markdown

Summary

  • preserve literal angle brackets when the desktop composer serializes Markdown
  • replace tiptap-markdown's HTML-escaping text node with a composer-specific serializer
  • add regression coverage for inline code, literal HTML entities, and existing Markdown punctuation

The upstream text serializer HTML-escaped < and > before Markdown rendering. Inline code preserves those entity strings literally, so messages such as <repo root>/website displayed as &lt;repo root&gt;/website.

Related issue

N/A — no matching open issue or pull request found.

Testing

  • just ci
  • focused composer Markdown serialization tests (3 passed)
  • full desktop unit suite (4,778 passed)
  • desktop TypeScript typecheck
  • changed-file Biome check

Manual regression case: type `<repo root>/website` in the desktop composer and send it. The rendered inline code should keep the angle brackets instead of showing HTML entities.

Before: the reported message displayed &lt;repo root&gt;/website.

After: the serializer regression test verifies the emitted Markdown remains `<repo root>/website`.

Original Bug

image

Signed-off-by: Nick DiZazzo <nick.dizazzo@gmail.com>
@ndizazzo
ndizazzo marked this pull request as ready for review August 13, 2026 23:57
@ndizazzo
ndizazzo requested a review from a team as a code owner August 13, 2026 23:57
@micspiral
micspiral enabled auto-merge (squash) August 14, 2026 00:01
@micspiral
micspiral requested a review from wesbillman August 14, 2026 00:02
@micspiral

Copy link
Copy Markdown
Collaborator

nice small one @wesbillman

@Chessing234

Copy link
Copy Markdown
Contributor

serializeComposerMarkdown does markdown.replace(/\\([*\~[]_])/g, "$1")before returning, so the helper strips exactly the backslash escapes the assertions are about. "Markdown punctuation and inline-code delimiters remain unchanged" therefore passes whether the serializer emittedboldor**bold**` — it cannot fail, and it is the test carrying the claim that this override does not disturb other escaping.

worth asserting on the raw serializer output for that case. the reason it matters: overriding the text node's serializer replaces the stock escaping for every markdown-significant character, not just </>, so *, _, [ and backticks are the ones to pin.

minor, possibly a no-op: state.text(node.text) — prosemirror-markdown's text(text, escape = true) defaults to escaping, so it is not obvious from the diff where the behaviour change comes from. if the fix works by bypassing tiptap-markdown's serializer rather than by that call, that is the thing to say in the comment.

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.

3 participants