Skip to content

[PR] fix: stop Markdown entity lines from looping in blockquote parsing - #6698

Merged
ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-14_literal-blockquote-entities
Nov 14, 2026
Merged

ranxianglei merged 1 commit into
ranxianglei:masterfrom
Afloat16:2026-11-14_literal-blockquote-entities

Conversation

@Afloat16

Copy link
Copy Markdown
Contributor

Problem

A literal > at the start of a Markdown source line enters the blockquote branch, but its inner loop only consumes a raw > marker. The source index never advances. Both server-rendered handoffs/articles and the browser renderer can therefore block indefinitely on ordinary text documenting an HTML entity.

Change

Recognize blockquotes from the raw > marker, using the same condition as the consuming loop. Literal entity text proceeds through the normal paragraph escaping path. Genuine quotes, code blocks, and paragraph formatting keep their existing behavior. The shared factory remains self-contained for browser inlining.

Verification

  • Four new tests include the public markdownToHtml() wrapper and an actual esbuild-minified factory evaluated without its module scope, matching browser inlining.
  • Seven source arrangements are checked on each rendering path: bare and spaced entity text, an entity without following text, HTML-sensitive text, and placement after a heading, a genuine quote, or a paragraph.
  • On unchanged base 9495c764d36909eec263f404d4802d68b608f23f, both rendering tests fail with ERR_SCRIPT_EXECUTION_TIMEOUT; the ordinary-quote and embedded/code-entity control tests pass. The VM execution budget interrupts synchronous nontermination instead of leaving the test runner hung.
  • After the fix, 22/22 related tests pass: the four new cases and all 18 existing Markdown/highlighter/inlining tests.
  • Full npm run typecheck, npm run build, and git diff --check pass. Full repository tests were not run locally; hosted CI remains pending.

Prior work checked

The complete Afloat16 historical patch index has no earlier change to this renderer. The actual heads of related #5482 and #5901 still contain the mismatched quote conditions; #4737 does not change either Markdown implementation, and #2270 changes the independent static website renderer. The separate inline-code patch only prevents later inline-format regexes from reinterpreting code spans; it does not address this block-level nontermination.

Closes #6697

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.

Literal > Markdown lines stall server and browser rendering

2 participants