Compare commits

..

1 Commits

Author SHA1 Message Date
YangFong
f27549acac
Merge 67ef9dc21c into 03b0e73acb 2024-12-24 09:17:34 +08:00

View File

@ -174,8 +174,6 @@ export function initRenderer(opts: IOpts) {
const langText = lang.split(` `)[0]
const language = hljs.getLanguage(langText) ? langText : `plaintext`
let highlighted = hljs.highlight(text, { language }).value
// tab to 4 spaces
highlighted = highlighted.replace(/\t/g, ' ')
highlighted = highlighted
.replace(/\r\n/g, `<br/>`)
.replace(/\n/g, `<br/>`)