mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-25 01:05:55 +03:00
[GH-ISSUE #1708] Proposal: Add rules for math block separation and heading emphasis #2588
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#2588
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 @obgnail on GitHub (Aug 9, 2025).
Original GitHub issue: https://github.com/DavidAnson/markdownlint/issues/1708
I would like to propose two new rules for markdownlint that are currently implemented in my own repository:
Math blocks should be surrounded by blank lines :This rule ensures that math blocks (delimited by
$$ ... $$) have blank lines before and after them, improving readability and consistency.Headings should not be fully emphasized :This rule prevents headings from being composed entirely of emphasized text (e.g.,
## **bold**or## _italic_), which can reduce clarity or hinder accessibility. Similar issue: #1608I believe these rules could benefit the markdownlint community by promoting best practices in markdown documents. Please let me know if you would consider including these rules, or if there are any requirements or guidelines I should follow when proposing new rules.
@obgnail commented on GitHub (Aug 9, 2025):
Here is my simple implementation:
@DavidAnson commented on GitHub (Aug 9, 2025):
The rule about blanks surrounding math blocks seems very natural and a quick scan of your implementation makes me think I would have relatively few feedback comments. If you want to create a pull request for that as rule MD061 (MD060 does not exist yet, but it is in progress), I think that would be reasonable.
Regarding your second rule about emphasized headings, I understand the intent and again the implementation looks reasonable. However I wonder if this is more popular in practice than we realize. If you are familiar with how this repository works, I would be very interested what happens when that rule is applied to the set of external test repositories. If/when you decide to add the first rule, it should be fairly clear how to evaluate the second in a similar manner. While the test repositories are somewhat arbitrary, they've been quite helpful in flagging patterns that are more popular than I expect.
@paulhm7 commented on GitHub (Feb 5, 2026):