Skip to content

Fix markdown-it text centering delmiter conflict - #2921

Merged
Incogdino merged 2 commits into
MarkBind:masterfrom
Incogdino:fix-markdown-it-delimiter
Aug 27, 2026
Merged

Fix markdown-it text centering delmiter conflict#2921
Incogdino merged 2 commits into
MarkBind:masterfrom
Incogdino:fix-markdown-it-delimiter

Conversation

@Incogdino

@Incogdino Incogdino commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • DevOps
  • Improve developer experience
  • Others, please explain:

Closes #2920

Overview of changes:
The plugin tagged its delimiters with the character code of - (45) and < (60). Other double-delimiter rules (e.g. the -- "small text" rule) also derive their marker from charCodeAt, so - collided with 45 too. Since inline rules share one state.delimiters array, the center-text post-processing pass grabbed unrelated delimiters and wrongly wrapped them in <div class="text-center">.

Switched the plugin's markers to negative sentinels (-1/-2), where no real character code produces so they can't collide with any other rule.

Anything you'd like to highlight/discuss:

Testing instructions:
Added regression test combining the two rules.

npm run test in packages/core directory

image

Proposed commit message: (wrap lines at 72 characters)

Fix markdown-it text centering delmiter conflict

Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No unrelated changes

Reviewer checklist:

Indicate the SEMVER impact of the PR:

  • Major (when you make incompatible API changes)
  • Minor (when you add functionality in a backward compatible manner)
  • Patch (when you make backward compatible bug fixes)

At the end of the review, please label the PR with the appropriate label: r.Major, r.Minor, r.Patch.

Breaking change release note preparation (if applicable):

  • To be included in the release note for any feature that is made obsolete/breaking

Give a brief explanation note about:

  • what was the old feature that was made obsolete
  • any replacement feature (if any), and
  • how the author should modify his website to migrate from the old feature to the replacement feature (if possible).

@Incogdino Incogdino changed the title Update centertext plugin to use negative sentinel markers Fix markdown-it text centering delmiter conflict Aug 26, 2026
@gerteck

gerteck commented Aug 26, 2026

Copy link
Copy Markdown
Member

Does it close #2716 as well? If so, can close that issue too!

@gerteck gerteck left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm preview site fixed

@Incogdino

Copy link
Copy Markdown
Contributor Author

@gerteck yup it fixes that. Will update the description and add some screenshots

@gerteck

gerteck commented Aug 26, 2026

Copy link
Copy Markdown
Member

Just checked, it doesn't fix the root cause of #2716 , let's keep it open, it's a vue hydration error that is quite hard to fix

A good proxy to check is to check the 404 page... (https://deploy-preview-2921--markbind-master.netlify.app/404 )

Currently the markbind site 404 page is also broken: https://markbind.org/404

<frontmatter>
    title: Page not found
    layout: 404.md
</frontmatter>

-><p style="font-size: 10rem">404</p><-
-><p style="font-size: 1.5rem">File not found<br>Click <a href="/">here</a> to go back to the home page.</p><-

but it properly fixes #2920

@codecov

codecov Bot commented Aug 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.33%. Comparing base (36426c7) to head (8b6f079).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #2921    +/-   ##
========================================
  Coverage   71.32%   71.33%            
========================================
  Files         133      133            
  Lines        7234     7236     +2     
  Branches     1612     1714   +102     
========================================
+ Hits         5160     5162     +2     
+ Misses       2068     1973    -95     
- Partials        6      101    +95     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@Incogdino
Incogdino merged commit ef88d70 into MarkBind:master Aug 27, 2026
11 checks passed
@github-actions

Copy link
Copy Markdown

@Incogdino Each PR must have a SEMVER impact label, please remember to label the PR properly.

@Incogdino Incogdino added the r.Patch Version resolver: increment by 0.0.1 label Aug 27, 2026
@damithc

damithc commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Thanks for the quick fix, @Incogdino 💯
Shall we do a patch release?

@Incogdino

Copy link
Copy Markdown
Contributor Author

@damithc v7.2.1 have been released including this patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r.Patch Version resolver: increment by 0.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Some text formatting syntax are not working anymore

3 participants