diff --git a/src/index.js b/src/index.js index 93e69e5f..10c67d39 100644 --- a/src/index.js +++ b/src/index.js @@ -129,7 +129,7 @@ export async function highlightText(src, lang, multiline = true, opt = {}) { await tokenize(src, lang, (str, type) => tmp += toSpan(sanitize(str), type)) return multiline - ? `
${'
'.repeat(!opt.hideLineNumbers && src.split('\n').length)}
${tmp}
` + ? `
${'
'.repeat(!opt.hideLineNumbers && src.replace(/\n$/, '').split('\n').length)}
${tmp}
` : tmp; }