mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Fix MD019/no-multiple-space-atx to ignore headings without content.
This commit is contained in:
parent
dc8e746cd2
commit
1ac2e6c3e8
2 changed files with 21 additions and 1 deletions
|
@ -13,7 +13,7 @@ module.exports = {
|
|||
filterTokens(params, "heading_open", (token) => {
|
||||
if (headingStyleFor(token) === "atx") {
|
||||
const { line, lineNumber } = token;
|
||||
const match = /^(#+)(\s{2,})/.exec(line);
|
||||
const match = /^(#+)(\s{2,})(?:\S)/.exec(line);
|
||||
if (match) {
|
||||
const [
|
||||
,
|
||||
|
|
20
test/headings-without-content.md
Normal file
20
test/headings-without-content.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
# Headings Without Content
|
||||
|
||||
<!-- markdownlint-disable single-title heading-style -->
|
||||
<!-- markdownlint-disable no-duplicate-heading no-trailing-spaces -->
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
#
|
||||
|
||||
##
|
||||
|
||||
##
|
||||
|
||||
##
|
||||
|
||||
##
|
Loading…
Add table
Add a link
Reference in a new issue