mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Merge 212d7abaae into 3db84df660
This commit is contained in:
commit
c206fc8a5e
2 changed files with 13 additions and 5 deletions
10
lib/rules.js
10
lib/rules.js
|
|
@ -575,17 +575,17 @@ module.exports = [
|
|||
"tags": [ "blockquote", "whitespace", "indentation" ],
|
||||
"aliases": [ "no-multiple-space-blockquote" ],
|
||||
"func": function MD027(params, errors) {
|
||||
var inBlockquote = false;
|
||||
var blockquoteNesting = 0;
|
||||
params.tokens.forEach(function forToken(token) {
|
||||
if (token.type === "blockquote_open") {
|
||||
inBlockquote = true;
|
||||
blockquoteNesting++;
|
||||
} else if (token.type === "blockquote_close") {
|
||||
inBlockquote = false;
|
||||
} else if ((token.type === "inline") && inBlockquote) {
|
||||
blockquoteNesting--;
|
||||
} else if ((token.type === "inline") && blockquoteNesting > 0) {
|
||||
token.content.split(shared.newLineRe)
|
||||
.forEach(function forLine(line, offset) {
|
||||
if (/^\s/.test(line) ||
|
||||
(!offset && /^\s*>\s\s/.test(token.line))) {
|
||||
(!offset && /^(\s*>)+\s\s/.test(token.line))) {
|
||||
errors.push(token.lineNumber + offset);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,3 +21,11 @@ Test the first line being indented too much:
|
|||
> Foo {MD027}
|
||||
> Bar {MD027}
|
||||
> Baz
|
||||
|
||||
Nested blockquote
|
||||
|
||||
> A {MD027}
|
||||
>
|
||||
> > B {MD027}
|
||||
>
|
||||
> C {MD027}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue