Repository navigation
feat(core): opt-in preserveWindowsPaths md4c flag - #1105
Open
juliusmarminge wants to merge 1 commit into
Open
juliusmarminge wants to merge 1 commit into
juliusmarminge wants to merge 1 commit into
Conversation
This was referenced Oct 27, 2026
juliusmarminge
force-pushed
the
fix/windows-path-escapes
branch
from
October 27, 2026 22:53
60f8909 to
ebd6365
Compare
juliusmarminge
added a commit
to pingdotgg/t3code
that referenced
this pull request
Oct 27, 2026
The native renderer read the \. in C:\Users\me\.t3 as an escape and dropped the separator. Ship the Enriched Markdown fork archive with the opt-in md4cFlags.preserveWindowsPaths (upstream software-mansion/enriched-markdown#1105) and turn it on, replacing the pnpm patch. The JS document parser used for PR descriptions keeps prose paths the same way. Co-authored-by: OhadC <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
CommonMark reads the \. in C:\Users\me\.config as an escape and drops the separator. With md4cFlags.preserveWindowsPaths, a backslash escape inside a Windows drive path in prose keeps its backslash. Escapes elsewhere, code, link destinations, titles and image alt text are unchanged. Uses ENRMRKD_FLAG_ESCAPEDTEXT from software-mansion-labs/md4c to tell an escape from a literal character. Co-Authored-By: Claude Opus 5.5 <[email protected]>
juliusmarminge
force-pushed
the
fix/windows-path-escapes
branch
from
October 27, 2026 23:22
ebd6365 to
4e76cb5
Compare
juliusmarminge
added a commit
to pingdotgg/t3code
that referenced
this pull request
Oct 27, 2026
The native renderer read the \. in C:\Users\me\.t3 as an escape and dropped the separator. Ship the Enriched Markdown fork archive with the opt-in md4cFlags.preserveWindowsPaths (upstream software-mansion/enriched-markdown#1105) and turn it on, replacing the pnpm patch. The JS document parser used for PR descriptions keeps prose paths the same way. Co-authored-by: OhadC <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What/Why?
CommonMark reads every
\before punctuation as an escape, so an agent's messageSaved to C:\Users\me\.t3\_build\shot.pngrenders asC:\Users\me.t3_build\shot.png. Coding-agent output mentions Windows paths all the time, and the dropped separators make them wrong.This adds an opt-in
md4cFlags.preserveWindowsPaths(off by default, so CommonMark output is unchanged). With it on, a backslash escape inside a Windows drive path in prose keeps its backslash:A path starts at a drive letter that is not preceded by a word character (
C:\,C:/, or a bareC:right before the escape) and runs through formatting spans such asC:/Users/**me**\.config. Whitespace, line breaks, code, math and images end it. Past whitespace nothing tells a path from a sentence, soC:\tmp \*x\*still gives*x*. Code spans, link destinations and titles, and image alt text are unchanged.To tell an escape from the literal character,
MD4CParseruses the newENRMRKD_FLAG_ESCAPEDTEXT/ENRMRKD_TEXT_ESCAPEDfrom software-mansion-labs/md4c#5. That PR needs to merge first.packages/core/cpp/enrmrkd/here is byte-identical to its head, and I'll re-runscripts/fetch-md4c.shonce it lands. The check scans only text appended since the last escape, so a paragraph with many escapes is not rescanned.The flag is plumbed like
preserveBlankLines: React Native (iOS, Android, web, measurement cache keys), the iOS and Android SDKs, the WASM wrapper (bundle rebuilt), and the docs.Testing
windows-paths.mdfixture in the golden AST dump. The flag is on in theextensions-onvariants and off in the rest, so the golden records both behaviors. No existing fixture's AST changed.scripts/test-core-parser.shandscripts/test-web-bundle.mjspass.md4c-flags.test.tsxcovers the default and forwarding of the new prop. The React Native package'stscand Jest suites pass (1,791 tests).enriched-markdown-iosbuilds for the iOS Simulator, and T3 Code's React Native iOS and Android dev clients build with this change.enriched-markdown-android::parser:assembleDebug,:ui:testDebugUnitTestandktlintCheckpass.PR Checklist
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.