Improve highlighting for MD027/no-multiple-space-blockquote, add more tests.

This commit is contained in:
David Anson 2017-10-29 20:54:14 -07:00
parent 1dce3e45d3
commit 681e8bae4e
5 changed files with 62 additions and 1 deletions

View file

@ -13,7 +13,7 @@ var htmlRe = /<[^>]*>/;
var listItemMarkerRe = /^[\s>]*(?:[*+-]|\d+\.)\s+/;
var listItemMarkerInterruptsRe = /^[\s>]*(?:[*+-]|1\.)\s+/;
var reversedLinkRe = /\([^)]+\)\[[^\]^][^\]]*]/;
var spaceAfterBlockQuote = />\s+\S/;
var spaceAfterBlockQuote = /^\s*(?:>\s+)+\S/;
var spaceBeforeHeaderRe = /^\s+\S/;
var spaceInsideCodeRe = /`(?:(?:\s[^`]*)|(?:[^`]*\s))`/;
var spaceInsideEmphasisRe = /(\*\*?|__?)(?:(?:\s.+)|(?:.+\s))\1/;

View file

@ -57,3 +57,19 @@ Text
Text
>> >> Text {MD027}
Text
> > Text {MD027}
Text
> > Text {MD027}
Text
> > Text {MD027}
Text
> > Text {MD027}

View file

@ -21,3 +21,15 @@ Test the first line being indented too much:
> Foo {MD027}
> Bar {MD027}
> Baz
Test spaces before the blockquote:
> Text {MD027}
Text
> Text {MD027}
Text
> Text {MD027}

View file

@ -11,3 +11,9 @@ Text
1. Alpha
2. Beta
> > Multiple spaces, multiple blockquotes
> >
> > > Multiple spaces, multiple blockquotes
> > >
> > > Multiple spaces, multiple blockquotes

View file

@ -53,6 +53,33 @@
"errorContext": "> Multiple spaces",
"errorRange": [1, 4]
},
{
"lineNumber": 15,
"ruleName": "MD027",
"ruleAlias": "no-multiple-space-blockquote",
"ruleDescription": "Multiple spaces after blockquote symbol",
"errorDetail": null,
"errorContext": "> > Multiple spaces, multiple...",
"errorRange": [ 1, 6 ]
},
{
"lineNumber": 17,
"ruleName": "MD027",
"ruleAlias": "no-multiple-space-blockquote",
"ruleDescription": "Multiple spaces after blockquote symbol",
"errorDetail": null,
"errorContext": "> > > Multiple spaces, multip...",
"errorRange": [ 1, 8 ]
},
{
"lineNumber": 19,
"ruleName": "MD027",
"ruleAlias": "no-multiple-space-blockquote",
"ruleDescription": "Multiple spaces after blockquote symbol",
"errorDetail": null,
"errorContext": "> > > Multiple spaces, multip...",
"errorRange": [ 1, 8 ]
},
{
"lineNumber": 9,
"ruleName": "MD028",