Fix MD019/no-multiple-space-atx to ignore headings without content.

This commit is contained in:
David Anson 2019-09-24 22:40:41 -07:00
parent dc8e746cd2
commit 1ac2e6c3e8
2 changed files with 21 additions and 1 deletions

View file

@ -13,7 +13,7 @@ module.exports = {
filterTokens(params, "heading_open", (token) => { filterTokens(params, "heading_open", (token) => {
if (headingStyleFor(token) === "atx") { if (headingStyleFor(token) === "atx") {
const { line, lineNumber } = token; const { line, lineNumber } = token;
const match = /^(#+)(\s{2,})/.exec(line); const match = /^(#+)(\s{2,})(?:\S)/.exec(line);
if (match) { if (match) {
const [ const [
, ,

View file

@ -0,0 +1,20 @@
# Headings Without Content
<!-- markdownlint-disable single-title heading-style -->
<!-- markdownlint-disable no-duplicate-heading no-trailing-spaces -->
#
#
#
#
##
##
##
##