Skip to content

Conversation

@stanley2058
Copy link

@stanley2058 stanley2058 commented Aug 28, 2025

Cause

  • Escape characters like \ go through rules_core/text_join.mjs and are converted from text_special to text and merged before other rules run. Causing later rules to lose the correct position info.

Fixes

  • Update rules_core/text_join.mjs to preserve position and size when merging adjacent text tokens.
  • Update token's size when creating a text_special token in rules_inline/escape.mjs to preserve the correct size before stripping the escape token.

Others

  • Also fix the regression for introducing the ZWSP character (which causes tests to break and missing trailing \n in some cases).

GPT-5 saved it 🙏

@stanley2058 stanley2058 requested a review from Yukaii August 28, 2025 04:39
@Yukaii Yukaii merged commit b412edd into hackmdio:master Aug 28, 2025
1 check 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.

2 participants