Skip to content

feat(parser): Enable Markdig Mathematics extension#449

Merged
artempyanykh merged 1 commit intoartempyanykh:mainfrom
abap34:mathmatics-extension
Jan 24, 2026
Merged

feat(parser): Enable Markdig Mathematics extension#449
artempyanykh merged 1 commit intoartempyanykh:mainfrom
abap34:mathmatics-extension

Conversation

@abap34
Copy link
Copy Markdown
Contributor

@abap34 abap34 commented Dec 30, 2025

Thank you for your continued maintenance work! I use marksman heavily for note-taking, and it has been extremely helpful.

Summary

As reported in #326, marksman currently produces incorrect diagnostics inside math blocks.
For example, bracket pairs can be interpreted as links (including wiki-links), which results in false, non-existent errors.

image

Another example (wiki-link):

image

To address this, this PR enables Markdig’s Mathematics extension via .UseMathematics().
This should make marksman treat $...$ / $$...$$ regions as math and avoid applying link parsing and link-related diagnostics inside them, reducing false reports.

Notes

This is a breaking change. However, I personally could not think of any content inside math blocks that should be treated or checked as links or something. I also suspect there are other link-like patterns in math blocks that currently trigger unnecessary checks, and enabling the math extension should help avoid those as well.

If there is a reason why marksman has intentionally not enabled this extension so far, please feel free to close this PR.

let actual = scrapeString content
checkInlineSnapshot actual []

module MathBlockTests =
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

❤️ Appreciate you adding tests!

@artempyanykh
Copy link
Copy Markdown
Owner

Brilliant! Thanks for the contribution @abap34!

This is a breaking change.

Appreciate you calling this out. I think it should be fine.

@artempyanykh artempyanykh merged commit 39ff504 into artempyanykh:main Jan 24, 2026
3 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.

2 participants