Repository navigation
feat(core): opt-in preserveWindowsPaths md4c flag (upstream #1105) - #10
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
18f2d8c to
4b18620
Compare
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 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4b18620 to
29ddd42
Compare
| } | ||
|
|
||
| if (type == ENRMRKD_TEXT_ESCAPED) { | ||
| const bool inImage = std::any_of(impl->nodeStack.begin(), impl->nodeStack.end(), |
There was a problem hiding this comment.
🟡 Medium parser/MD4CParser.cpp:605
With preserveWindowsPaths enabled, each ENRMRKD_TEXT_ESCAPED callback scans the entire nodeStack to check for an image, so deeply nested blockquotes followed by many escapes incur O(depth × escapes) work and can stall synchronous parsing. Track image nesting on node entry and exit instead of searching all ancestors for every escaped character.
🚀 Reply "fix it for me" or copy this AI Prompt for your agent:
In file @packages/core/cpp/parser/MD4CParser.cpp around line 605:
With `preserveWindowsPaths` enabled, each `ENRMRKD_TEXT_ESCAPED` callback scans the entire `nodeStack` to check for an image, so deeply nested blockquotes followed by many escapes incur O(depth × escapes) work and can stall synchronous parsing. Track image nesting on node entry and exit instead of searching all ancestors for every escaped character.
Carries software-mansion/enriched-markdown#1105 (opt-in
md4cFlags.preserveWindowsPaths), which depends on software-mansion-labs/md4c#5.test-core-parser.shandtest-web-bundle.mjspass on this branch.T3 Code consumes the archive packed from 29ddd42 in pingdotgg/t3code#21454. Merge this with it.
Model: Claude Opus 5.5. Harness: Claude Code in T3 Code.