mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 14:30:12 +01:00
MD014 should not warn for empty blocks.
This commit is contained in:
parent
fb31bb5f35
commit
26ab9a5596
3 changed files with 23 additions and 2 deletions
|
|
@ -342,10 +342,11 @@ module.exports = [
|
|||
"func": function MD014(params, errors) {
|
||||
[ "code_block", "fence" ].forEach(function forType(type) {
|
||||
filterTokens(params, type, function forToken(token) {
|
||||
var allBlank = true;
|
||||
if (token.content && token.content.split(shared.newLineRe)
|
||||
.every(function forLine(line) {
|
||||
return !line || /^\$\s/.test(line);
|
||||
})) {
|
||||
return !line || (allBlank = false) || /^\$\s/.test(line);
|
||||
}) && !allBlank) {
|
||||
errors.push(token.lineNumber);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue