Repository navigation
fix(shared): keep fenced examples intact after inline HTML - #43803
Conversation
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: GPT 6.2 Sol <codex@openai.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Splitting a long document with many prose paragraphs followed by a lone tag line parsed every such paragraph, so splitMarkdown grew from a linear scan to seconds on multi-megabyte files. One 16 KB parse budget now covers the whole document; past it, tags fall back to the existing hold until the next blank line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…8977c689a38 Keep main's multi-line link definitions and gate them on the unresolved inline HTML hold, as the single-line definitions were. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
EvidenceCreated release.md with a long paragraph, immediately followed by and a Markdown fence containing Sample Markdown, a blank line, and literal # Sample heading. Opened the same file preview flow on both commits and selected Show rendered markdown. Chromium, 1280×800, light theme, fresh synthetic state with Replay (dev).
Scenario source. Before recording, after recording. scenarios:prove exited 0: fails on base and passes on head. |


Large Markdown previews could split a code fence after a standalone inline HTML tag and render a sample heading as a document heading. The splitter now uses bounded tag classification and defers cuts when it is uncertain, while continuing to track fences and other multiline blocks through their closers. A browser test asserts that the sample text and literal heading render inside the same code block.
Related: #43647, #23503, #33969, #43654, #43673, #43711, #43709
Reproduction on main
Commit f08bafe07f (main), in the running web app:
Sample heading appears as a heading of the document, outside the code example. Expected: Sample heading stays inside the code example.
The cause is at
packages/shared/src/markdownChunks.ts:84. Ranpnpm scenarios:prove scripts/scenarios/markdown-inline-tag-before-fence.e2e.ts --target webwith the repro scenario added: it failed in 2 of 2 runs on a clean checkout, withexpect.not.toBeVisible failedin the output.Evidence
Environment: The web app in Chromium on Linux x64, a fresh checkout.
Proven: the repro fails at the test commit 012fc62e1a and passes on the head d18e7f21a8, both on main f4b252309f.
Before the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/9086af4f-fdd8-482f-91c9-a9bad5fbd862/before-recording.webm
After the fix, recorded:
https://pub-b182a4071edc4521829926b34990540b.r2.dev/files/1a6ac44e-10ce-4adc-9691-ca6521608eaf/after-recording.webm
Outside view: a person sees it in the running web app by following the steps under Reproduction on main.
Tests
pnpm exec vp run check:changed f4b252309ff9c5acc18c180141d92c6ac08b0027passed on head.Not in this change
Who did the work
Made in T3 Code by GPT 6.2 Sol, Claude Opus 5.5, Grok 4.7 and Gemini 4 Neon