mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Remove automatic fix from MD028/no-blanks-blockquote due to ambiguity (fixes #315).
This commit is contained in:
parent
a6d30cb724
commit
09c5736385
4 changed files with 21 additions and 12 deletions
|
|
@ -960,8 +960,6 @@ Tags: blockquote, whitespace
|
||||||
|
|
||||||
Aliases: no-blanks-blockquote
|
Aliases: no-blanks-blockquote
|
||||||
|
|
||||||
Fixable: Most violations can be fixed by tooling
|
|
||||||
|
|
||||||
This rule is triggered when two blockquote blocks are separated by nothing
|
This rule is triggered when two blockquote blocks are separated by nothing
|
||||||
except for a blank line:
|
except for a blank line:
|
||||||
|
|
||||||
|
|
|
||||||
10
lib/md028.js
10
lib/md028.js
|
|
@ -18,15 +18,7 @@ module.exports = {
|
||||||
let lineNumber = prevLineNumber;
|
let lineNumber = prevLineNumber;
|
||||||
lineNumber < token.lineNumber;
|
lineNumber < token.lineNumber;
|
||||||
lineNumber++) {
|
lineNumber++) {
|
||||||
addError(
|
addError(onError, lineNumber);
|
||||||
onError,
|
|
||||||
lineNumber,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
null,
|
|
||||||
{
|
|
||||||
"deleteCount": -1
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prevToken = token;
|
prevToken = token;
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ Text
|
||||||
## Another heading
|
## Another heading
|
||||||
|
|
||||||
> Multiple spaces
|
> Multiple spaces
|
||||||
|
|
||||||
> Blank line above
|
> Blank line above
|
||||||
|
|
||||||
1. Alpha
|
1. Alpha
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ tape("applyFix", (test) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
tape("applyFixes", (test) => {
|
tape("applyFixes", (test) => {
|
||||||
test.plan(28);
|
test.plan(29);
|
||||||
const testCases = [
|
const testCases = [
|
||||||
[
|
[
|
||||||
"Hello world.",
|
"Hello world.",
|
||||||
|
|
@ -886,6 +886,24 @@ tape("applyFixes", (test) => {
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Hello\r\nworld\r\n\r\n"
|
"Hello\r\nworld\r\n\r\n"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"Hello world",
|
||||||
|
[
|
||||||
|
{
|
||||||
|
"lineNumber": 1,
|
||||||
|
"fixInfo": {
|
||||||
|
"insertText": "x"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"lineNumber": 1,
|
||||||
|
"fixInfo": {
|
||||||
|
"deleteCount": -1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
""
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
testCases.forEach((testCase) => {
|
testCases.forEach((testCase) => {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue