Update MD018/MD019/MD020/MD021 to look specifically for "space" characters (space or tab) instead of RegExp's "\s" characters per CommonMark specification (fixes #367).

This commit is contained in:
David Anson 2021-02-03 22:05:07 -08:00
parent d2d4b310b9
commit 5aef3a4a51
6 changed files with 50 additions and 8 deletions

View file

@ -13,7 +13,7 @@ module.exports = {
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
if (!inCode) {
const match =
/^(#+)(\s*)([^#]*?[^#\\])(\s*)((?:\\#)?)(#+)(\s*)$/.exec(line);
/^(#+)([ \t]*)([^#]*?[^#\\])([ \t]*)((?:\\#)?)(#+)(\s*)$/.exec(line);
if (match) {
const [
,