This commit is contained in:
amehime
2020-05-27 01:07:45 +08:00
parent 46e472cbec
commit 10ba995760

View File

@@ -68,21 +68,25 @@ module.exports = function (md, options) {
for (let i = 0, len = lines.length; i < len; i++) {
let line = lines[i];
let append = '';
let lineno = Number(firstLine) + i
numbers += `<span class="line">${lineno}</span><br>`;
content += '<span class="line';
if (mark && mark.includes(lineno)) {
content += ` marked`;
append = `<span class="marked`;
}
if (command && command[lineno]) {
content += `" data-command="${command[lineno]}`;
append += `" data-command="${command[lineno]}`;
}
content += `">${line}</span><br>`;
if (append) {
content += `${append}${line}</span><br>`;
} else {
content += `${line}<br>`;
}
}
let result = `<figure class="highlight${langToUse ? ` ${langToUse}` : ''}">`;