Account for front matter when calculating range for resultVersion 1 (fixes #48).

This commit is contained in:
David Anson 2017-03-14 21:58:39 -07:00
parent 5a1fb40871
commit 1b44ed54e4
4 changed files with 32 additions and 1 deletions

View file

@ -255,7 +255,8 @@ function lintContent(content, config, frontMatter, resultVersion) {
if (typeof regexp === "function") {
regexp = regexp(params.options);
}
var match = lines[error.lineNumber - 1].match(regexp);
var lineIndex = error.lineNumber - frontMatterLines - 1;
var match = lines[lineIndex].match(regexp);
if (match) {
var column = match.index + 1;
var length = match[0].length;