mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-20 16:00:13 +01:00
Account for front matter when calculating range for resultVersion 1 (fixes #48).
This commit is contained in:
parent
5a1fb40871
commit
1b44ed54e4
4 changed files with 32 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue