Skip to content

Commit

Permalink
fix: prevent firstLine being parsed as a string
Browse files Browse the repository at this point in the history
  • Loading branch information
curbengh committed Aug 4, 2019
1 parent 5005990 commit 2a7f79f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ function highlightUtil(str, options = {}) {
for (let i = 0, len = lines.length; i < len; i++) {
let line = lines[i];
if (tab) line = replaceTabs(line, tab);
numbers += `<span class="line">${firstLine + i}</span><br>`;
content += formatLine(line, firstLine + i, mark, options);
numbers += `<span class="line">${Number(firstLine) + i}</span><br>`;
content += formatLine(line, Number(firstLine) + i, mark, options);
}

let result = `<figure class="highlight${data.language ? ` ${data.language}` : ''}">`;
Expand Down

0 comments on commit 2a7f79f

Please sign in to comment.