Add MD037 with tests, improve handling of line numbers for inlines.

This commit is contained in:
David Anson 2015-04-15 17:50:01 -07:00
parent bd7e712728
commit b85e53a9c4
6 changed files with 108 additions and 21 deletions

View file

@ -72,6 +72,14 @@ function lintFile(file, config, synchronous, callback) {
while (!(lines[token.map[1] - 1].trim())) {
token.map[1]--;
}
// Annotate children with lineNumber
var lineNumber = token.lineNumber;
(token.children || []).forEach(function forChild(child) {
child.lineNumber = lineNumber;
if ((child.type === "softbreak") || (child.type === "hardbreak")) {
lineNumber++;
}
});
}
});
// Create parameters for rules