Skip to content

feat(core): opt-in preserveWindowsPaths md4c flag (upstream #1105) - #10

Merged
juliusmarminge merged 2 commits into
fork/t3-mobilefrom
t3/windows-path-escapes
Oct 27, 2026
Merged

juliusmarminge merged 2 commits into
fork/t3-mobilefrom
t3/windows-path-escapes

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Oct 27, 2026 •

Copy link
Copy Markdown
Member

Carries software-mansion/enriched-markdown#1105 (opt-in md4cFlags.preserveWindowsPaths), which depends on software-mansion-labs/md4c#5.

  • 2ed3174 is a clean cherry-pick of the upstream PR's commit (4e76cb5), so the next upstream sync can drop it.
  • 29ddd42 rebuilds the web WASM bundle from the fork's sources. test-core-parser.sh and test-web-bundle.mjs pass 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.

@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: 96f96797-fa78-439a-97d7-1872d7dd5b0b

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Comment thread packages/core/cpp/parser/MD4CParser.cpp Resolved
juliusmarminge and others added 2 commits October 27, 2026 16:22
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>
@juliusmarminge
juliusmarminge force-pushed the t3/windows-path-escapes branch from 4b18620 to 29ddd42 Compare October 27, 2026 23:22
}

if (type == ENRMRKD_TEXT_ESCAPED) {
const bool inImage = std::any_of(impl->nodeStack.begin(), impl->nodeStack.end(),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@juliusmarminge
juliusmarminge merged commit 29ddd42 into fork/t3-mobile Oct 27, 2026
8 checks passed
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.

1 participant