Fix bug in MD022 where it could report errors on line 0, add tests.

This commit is contained in:
David Anson 2015-09-07 14:04:28 -07:00
parent bb0d8a36b3
commit c98660c492
3 changed files with 21 additions and 6 deletions

View file

@ -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);
}
}
});
}