mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 06:50:12 +01:00
Handle case where token map extends beyond last line of input (fixes #166).
This commit is contained in:
parent
90bd0810e7
commit
3e753636cf
2 changed files with 30 additions and 1 deletions
|
|
@ -164,7 +164,7 @@ function annotateTokens(tokens, lines) {
|
|||
token.line = lines[token.map[0]];
|
||||
token.lineNumber = token.map[0] + 1;
|
||||
// Trim bottom of token to exclude whitespace lines
|
||||
while (token.map[1] && !(lines[token.map[1] - 1].trim())) {
|
||||
while (token.map[1] && !((lines[token.map[1] - 1] || "").trim())) {
|
||||
token.map[1]--;
|
||||
}
|
||||
// Annotate children with lineNumber
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue