LearnNewsExamplesServices
Frontmatter
id8858
titleMarkdown component: Exclude code blocks from ticket ID linking
stateClosed
labels
bugai
assigneestobiu
createdAtJan 22, 2026, 12:14 AM
updatedAtJan 22, 2026, 12:15 AM
githubUrlhttps://github.com/neomjs/neo/issues/8858
authortobiu
commentsCount1
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJan 22, 2026, 12:15 AM

Markdown component: Exclude code blocks from ticket ID linking

Closed v11.23.1 bugai
tobiu
tobiu commented on Jan 22, 2026, 12:14 AM

The current replaceTicketIds logic in Neo.component.Markdown aggressively replaces #123 patterns inside code blocks (fenced and inline) with HTML links. This corrupts code examples, especially CSS hex codes or comments containing hashes.

We need to update the modifyMarkdown method to:

  1. Temporarily mask fenced code blocks.
  2. Temporarily mask inline code blocks.
  3. Perform the ticket ID replacement.
  4. Restore the masked blocks.

This ensures that only ticket references in the prose text are linked.

tobiu added the bug label on Jan 22, 2026, 12:14 AM
tobiu added the ai label on Jan 22, 2026, 12:14 AM
tobiu referenced in commit 5313b09 - "fix(Markdown): Exclude code blocks from ticket ID linking (#8858)" on Jan 22, 2026, 12:14 AM
tobiu assigned to @tobiu on Jan 22, 2026, 12:15 AM
tobiu
tobiu Jan 22, 2026, 12:15 AM

Input from Gemini 3 Pro:

✦ I have implemented the fix by introducing a masking step in modifyMarkdown.

  1. Fenced code blocks (```...```) are replaced with __NEO_CODE_BLOCK_X__.
  2. Inline code blocks ( ... ) are replaced with __NEO_INLINE_CODE_X__.
  3. Ticket replacement runs on the masked text.
  4. The masked tokens are replaced back with the original code.

This prevents #123 inside code blocks (like CSS hex colors or comments) from being turned into links. Changes pushed to dev in commit 5313b0968.

tobiu closed this issue on Jan 22, 2026, 12:15 AM