question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

MD022 - Headings should be surrounded by blank lines

See original GitHub issue

I’d like to configure this warning to:

  • Require a preceding empty line (as it already does)
  • Not requiring a following empty line

So this should be OK:

something

# Heading
more text

But this should not be OK:

something
# Heading
more text

The docs explain why you must have an empty line before the heading (kramdown), but only cites aesthetics for why you should have an empty line after the heading.

And as a lot of our markdown has no empty line after headings, and I actually like it this way, I’d like to be able to inform Markdownlint about this.

Regards /Johan

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
vukanaccommented, Dec 20, 2018

Is it possible to configure markdownlinter to force usage of 2 empty lines before headings and 1 after?

0reactions
DavidAnsoncommented, Mar 31, 2019

Yes, I mention that consequence here: https://github.com/DavidAnson/markdownlint/blob/master/doc/Rules.md#md022

Because rules are independent, I don’t see a good way to avoid this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Markdownlint Rules
Rationale: Headings represent the structure of a document and can be confusing when skipped ... MD022 - Headings should be surrounded by blank...
Read more >
doc/Rules.md · Gitee 极速下载/markdownlint - Gitee.com
Note: this rule will fire if either side of the heading contains multiple spaces. MD022 - Headings should be surrounded by blank lines....
Read more >
markdownlint-cli2-formatter-default/README.md - UNPKG
36, dir/subdir/info.md:1 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; Actual: 0; Below] [ ...
Read more >
markdownlint-cli2-formatter-pretty - npm
... dir/subdir/info.md:1 MD022/blanks-around-headings/blanks-around-headers Headings should be surrounded by blank lines [Expected: 1; ...
Read more >
markdownlint demo - David Anson
Click a violation for information about it or click its line number to ... 16 - MD022 / blanks-around-headings Headings should be surrounded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found