Repository navigation
Conversation
…ference destinations
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Thanks for this. Main already has the change, as of 3ebc46f. Main now recognizes reference definitions with Remark instead of the restrictive regex this PR changes. That replacement in 3ebc46f867 already accepts escaped angle brackets and preserves the definition for other chunks, while leaving invalid destinations unresolved. The focused regression cases remain useful coverage for the replacement parser, but the implementation fix is already covered on main. Closing as superseded. |
Problem
Large Markdown file previews leave valid reference links literal when their angle-wrapped destination contains an escaped angle bracket. The definition scanner rejects the escape even though the renderer accepts it.
Deterministic repro on
origin/main(beb24ffed87bbb45e81dd27c7f253c30e83b2599)Use this exact synthetic fixture with the default chunk size:
Render
textandfirstthroughwordsHastusing the existingwordsHtmlhelper inapps/web/src/markdown/wordsHast.test.ts. The runtime transcript includes the full temporary probe and its command:Observed: two chunks, an empty
definitionsstring, and literal[guide][ref]in the first chunk. Expected:guidelinks tohttps://example.com/a%3Cb, matching whole-document rendering. An unescaped inner<is the negative control and must remain unresolved.Change
Make the angle-destination regex consume backslash escapes as pairs, accepting escaped
<and>while rejecting unescaped inner brackets, escaped closing delimiters, and physical line endings. Web/desktop and mobile file previews use this shared scanner; no separate client fix or translation is needed.Scope
Small fix for an obvious bug; no issue needed under CONTRIBUTING.md.
Verification
<and>cases fail because the first chunk has no expected link.vp test run packages/shared/src/markdownChunks.test.ts: 28/28 passed in each of three consecutive runs. Controls cover paired backslashes, unescaped inner brackets, and CR/LF.vp run check:changed: exit 0.wordsHastchanges from literal text to the expected link; whole-document output and the invalid control stay consistent.Authored by GPT-6.1 Sol (Codex); reviewed by Gemini 4 Neon (Antigravity).