Fix issue in MD020/no-missing-space-closed-atx that reported errors for single-character headers (fixes #229).

This commit is contained in:
David Anson 2019-10-23 19:56:24 -07:00
parent 31ffe52f0f
commit 84b6d935f5
2 changed files with 84 additions and 1 deletions

View file

@ -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 [
,