mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-21 21:30:47 +02:00
Fix issue in MD020/no-missing-space-closed-atx that reported errors for single-character headers (fixes #229).
This commit is contained in:
parent
31ffe52f0f
commit
84b6d935f5
2 changed files with 84 additions and 1 deletions
|
@ -13,7 +13,7 @@ module.exports = {
|
|||
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
||||
if (!inCode) {
|
||||
const match =
|
||||
/^(#+)(\s*)([^#]+?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(line);
|
||||
/^(#+)(\s*)([^#]*?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(line);
|
||||
if (match) {
|
||||
const [
|
||||
,
|
||||
|
|
83
test/short-headings.md
Normal file
83
test/short-headings.md
Normal file
|
@ -0,0 +1,83 @@
|
|||
# Short Headings
|
||||
|
||||
<!-- markdownlint-disable single-title heading-style -->
|
||||
|
||||
#A
|
||||
|
||||
{MD018:5}
|
||||
|
||||
# B
|
||||
|
||||
# C
|
||||
|
||||
{MD019:11}
|
||||
|
||||
#D#
|
||||
|
||||
{MD020:15}
|
||||
|
||||
# E #
|
||||
|
||||
# F #
|
||||
|
||||
{MD021:21}
|
||||
|
||||
##G
|
||||
|
||||
{MD018:25}
|
||||
|
||||
## H
|
||||
|
||||
## I
|
||||
|
||||
{MD019:31}
|
||||
|
||||
##J##
|
||||
|
||||
{MD020:35}
|
||||
|
||||
## K ##
|
||||
|
||||
## L ##
|
||||
|
||||
{MD021:41}
|
||||
|
||||
#MM
|
||||
|
||||
{MD018:45}
|
||||
|
||||
# NN
|
||||
|
||||
# OO
|
||||
|
||||
{MD019:51}
|
||||
|
||||
#PP#
|
||||
|
||||
{MD020:55}
|
||||
|
||||
# QQ #
|
||||
|
||||
# RR #
|
||||
|
||||
{MD021:61}
|
||||
|
||||
##SS
|
||||
|
||||
{MD018:65}
|
||||
|
||||
## TT
|
||||
|
||||
## UU
|
||||
|
||||
{MD019:71}
|
||||
|
||||
##VV##
|
||||
|
||||
{MD020:75}
|
||||
|
||||
## WW ##
|
||||
|
||||
## XX ##
|
||||
|
||||
{MD021:81}
|
Loading…
Add table
Add a link
Reference in a new issue