mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-22 08:50:13 +01:00
Re-implement MD022/blanks-around-headings to ignore comments and blockquotes.
This commit is contained in:
parent
1db87ef0c6
commit
debc08bca1
5 changed files with 16 additions and 35 deletions
|
|
@ -11,10 +11,9 @@ module.exports = {
|
|||
"tags": [ "code", "blank_lines" ],
|
||||
"function": function MD031(params, onError) {
|
||||
const { lines } = params;
|
||||
const { length } = lines;
|
||||
forEachLine(function forLine(line, i, inCode, onFence) {
|
||||
if (((onFence > 0) && (i - 1 >= 0) && !isBlankLine(lines[i - 1])) ||
|
||||
((onFence < 0) && (i + 1 < length) && !isBlankLine(lines[i + 1]))) {
|
||||
if (((onFence > 0) && !isBlankLine(lines[i - 1])) ||
|
||||
((onFence < 0) && !isBlankLine(lines[i + 1]))) {
|
||||
addErrorContext(onError, i + 1, lines[i].trim());
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue