Skip to content

Update markdown-it-attrs version - #2907

Merged
gerteck merged 1 commit into
MarkBind:masterfrom
Incogdino:fix-end-of-block-build-error
Jul 28, 2026
Merged

Update markdown-it-attrs version#2907
gerteck merged 1 commit into
MarkBind:masterfrom
Incogdino:fix-end-of-block-build-error

Conversation

@Incogdino

@Incogdino Incogdino commented Jul 28, 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 #2905

Overview of changes:
Bumped markdown-it-attrs from ^4.1.3 to ^5.0.1.

Markbind's inline markdown rendering path (MarkdownProcessor.renderMdInline, used for include-panel processing) calls md.renderInline(). When inline source has a trailing {.class} attribute pattern (e.g.Some text{.text-danger}), markdown-it-attrs' "end of block" pattern transform walks past end of the token array looking for a surrounding block token, it then throws error and the plugin swallows the error by printing it to console.error while silently dropping the attribute.

This issue was fixed upstream in markdown-it-attrs v5.0.1 (arve0/markdown-it-attrs#184), which bounds-checks the token walk and returns early instead of erroring.

v5.0.0 also changed fenced-code-block attribute placement (moves attrs from <code> to the outer <pre> by default, via a new fenceAttrsOnPre option). This does not affect us as markbind registers its own custom fence renderer so it overrides the plugin's fence renderer regardless of that option.

Anything you'd like to highlight/discuss:

Testing instructions:
Render a page/include with inline text containing a trailing {.class} attribute (e.g. Some text{.text-danger}) through a path that hits renderInline. Confirm no error printed and class is applied to the output.

Alternatively, try running markbind build on the following repo: git-mastery.github.io

Proposed commit message: (wrap lines at 72 characters)
Bump markdown-it-attrs to 5.0.1 to fix renderInline error


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

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.32%. Comparing base (dcff376) to head (b336ce5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2907   +/-   ##
=======================================
  Coverage   71.32%   71.32%           
=======================================
  Files         133      133           
  Lines        7234     7234           
  Branches     1682     1650   -32     
=======================================
  Hits         5160     5160           
  Misses       2068     2068           
  Partials        6        6           

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

@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! Verified that the solution works, no error on minimal reproduction suggested by @Harjun751

@gerteck
gerteck merged commit 6bbfc2e into MarkBind:master Jul 28, 2026
11 checks passed
@github-actions github-actions Bot added the r.Patch Version resolver: increment by 0.0.1 label Jul 28, 2026
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.

Build error after upgrading to v7.1.2

2 participants