Fix window is not defined for parsing code blocks

This commit is contained in:
Hongbo Wu
2022-05-17 11:01:55 +08:00
parent 20ea93168f
commit e76fb02f43

View File

@ -257,7 +257,7 @@ export const parsePreparedContent = async (
console.log(e.textContent)
if (e.textContent) {
const att = hljs.highlightAuto(e.textContent)
const code = window.document.createElement('code')
const code = dom.createElement('code')
const langClass =
`hljs language-${att.language}` +
(att.second_best?.language