Skip to content

Commit d0856d5

Browse files
committed
Touch up hljs in build.js
1 parent dc96ade commit d0856d5

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

book/build.js

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,15 +65,14 @@ while (dirs.length) {
6565
return;
6666
}
6767
const lang = langClass.replace('language-', '');
68-
const lines = node.html().split('\n');
69-
const boring = lines.map((line) =>
68+
const originalLines = node.html().split('\n');
69+
const boring = originalLines.map((line) =>
7070
line.includes('<span class="boring">'),
7171
);
72-
const ellipsis = lines.map((line) => line.includes('// ...'));
72+
const ellipsis = originalLines.map((line) => line.includes('// ...'));
7373
const target = entities.decode(node.text());
74-
const highlighted = hljs.highlight(lang, target).value;
75-
const result = highlighted
76-
.split('\n')
74+
const highlightedLines = hljs.highlight(lang, target).value.split('\n');
75+
const result = highlightedLines
7776
.map(function (line, i) {
7877
if (boring[i]) {
7978
line = '<span class="boring">' + line;

0 commit comments

Comments
 (0)