mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Fix bug in MD022 where it could report errors on line 0, add tests.
This commit is contained in:
parent
bb0d8a36b3
commit
c98660c492
3 changed files with 21 additions and 6 deletions
|
@ -428,7 +428,10 @@ module.exports = [
|
|||
token.content.split(shared.newLineRe)
|
||||
.forEach(function forLine(line, offset) {
|
||||
if (/^(-+|=+)\s*$/.test(line)) {
|
||||
errors.push(token.map[0] + offset);
|
||||
var seTextLineNumber = token.map[0] + offset;
|
||||
if (seTextLineNumber > 0) {
|
||||
errors.push(seTextLineNumber);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue