Skip to content

Commit bba0efe

Browse files
author
Ty
committed
Optimize toLowerCase() function placement
1 parent 82b4d33 commit bba0efe

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,9 @@ export default async ({ markdownAST }, options = {}) => {
129129
let html = content.div;
130130
if (query.highlights.length > 0) {
131131
const $ = cheerio.load(content.div);
132-
const file = query.file.replace(/[^a-zA-Z0-9_]+/g, "-");
132+
const file = query.file.replace(/[^a-zA-Z0-9_]+/g, "-").toLowerCase();
133133
query.highlights.forEach(line => {
134-
$(`#file-${file.toLowerCase()}-LC${line}`).addClass("highlighted");
134+
$(`#file-${file}-LC${line}`).addClass("highlighted");
135135
});
136136

137137
html = $.html();

0 commit comments

Comments
 (0)