mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 09:16:02 +03:00
[GH-ISSUE #1460] Equation spanning multiple lines break MD022 #2538
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#2538
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @exzombie on GitHub (Jan 8, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1460
I'm using Pandoc's math extension to write displayed equations. As long as the equation fits into one line, everything is fine. If it is split into multiple lines, the rule MD022 is somehow broken for the rest of the document.
For example, this works fine:
But this does not:
After writing such an equation, markdownlint no longer warns about blanks around headings. I'm not sure about other rules; I know that MD013 still works, but I didn't go test all the rules. MD022 is the only one I noticed so far.
I'm using markdownlint through markdownlint-cli version 0.42.0, and rule MD022 is configured as follows:
@DavidAnson commented on GitHub (Jan 8, 2025):
As I understand the grammar, what you show above is probably getting parsed as a block/fence instead of an inline. If so, it will be unterminated and the rest of the document treated as math content. Try putting the delimiters on their own line. Your example works for me as an inline or a fence once I disambiguate it.
https://dlaa.me/markdownlint/#%25m%23%20Issue%201460%0A%0A%24%24%20a%20%3D%0A%20%20%20b%20%24%24%0A
https://github.com/micromark/micromark-extension-math?tab=readme-ov-file#syntax
@DavidAnson commented on GitHub (Jan 8, 2025):
(You could probably also switch to single dollar to force this as an inline since that's not valid as a block delimiter.)
@exzombie commented on GitHub (Jan 9, 2025):
Putting the dollars into their own lines works very well as a workaround. Thank you!