Skip to content

fix(render): prevent delimiter adjacency breakouts - #65

Merged
chaliy merged 1 commit into
mainfrom
fix/render-delimiter-adjacency
Oct 31, 2026
Merged

chaliy merged 1 commit into
mainfrom
fix/render-delimiter-adjacency

Conversation

@chaliy

@chaliy chaliy commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

What changed

Keep rendered Markdown safe when nested inline delimiters or adjacent IR nodes would otherwise combine into syntax the IR did not request. Redundant nested bold, italic, and strikethrough wrappers render once. Text beginning with ( is escaped after a bracketed node so a footnote reference cannot become an inline link that consumes later delimiters.

Why

The post-merge full fuzz run found a repeated-bold case that closed its outer span before a block node and exposed code as raw HTML. A follow-up local run found the same output-safety failure when a footnote reference and following text combined into an inline link.

Before / After

  • Before: redundant ** delimiters or [^x] followed by ( could consume later Markdown delimiters and expose code content as HTML in a downstream GFM renderer.
  • After: both minimized crash artifacts replay successfully. Their exact inputs are retained as seeds and covered by output-safety regressions.
  • just pre-pr: passed, including 51 output-safety tests and 119 HTML integration tests.
  • Local render_ir fuzz: 500,715 inputs over 61 seconds with no crash.
  • The committed tree is identical to the tree validated before moving this commit onto the merged main branch.

Risk

  • Medium: redundant nested emphasis wrappers render once, and ( after a bracketed node may be escaped.
  • Text and code content remain intact; no resource limits or security assertions are relaxed.

Checklist

  • Tests added or updated
  • Backward compatibility considered

@chaliy
chaliy merged commit 1df8550 into main Oct 31, 2026
14 checks passed
@chaliy
chaliy deleted the fix/render-delimiter-adjacency branch October 31, 2026 04:22
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