[PR #452] Bug/parsing math #1040

Closed
opened 2026-01-29 14:48:55 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/xoofx/markdig/pull/452

State: closed
Merged: Yes


This fixes #451

Before my change the parser would look to see if the next character after the or$ was a digit. It would then fail to match if it was a digit, which means that $x$ would be a valid math block but $2x$ would not be.

I simply removed this check as $2x$ should be valid, but it still allows $ 2x $ in order to be backwards compatible.

I also changed the WebApi project comment that specified that the second parameter should be extensions, where as actually it should just be extension as per the controller method definition. This confused me when I was trying to replicate the bug.

**Original Pull Request:** https://github.com/xoofx/markdig/pull/452 **State:** closed **Merged:** Yes --- This fixes [#451](https://github.com/lunet-io/markdig/issues/451) Before my change the parser would look to see if the next character after the $ or $$ was a digit. It would then fail to match if it _was_ a digit, which means that `$x$` would be a valid math block but `$2x$` would not be. I simply removed this check as `$2x$` should be valid, but it still allows `$ 2x $` in order to be backwards compatible. I also changed the WebApi project comment that specified that the second parameter should be **extensions**, where as actually it should just be **extension** as per the controller method definition. This confused me when I was trying to replicate the bug.
claunia added the pull-request label 2026-01-29 14:48:55 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#1040