mirror of
https://github.com/versia-pub/frontend.git
synced 2026-03-13 03:29:16 +01:00
refactor: 🔥 Remove syntax highlighting for performance
This commit is contained in:
parent
68e5ede6c6
commit
55ca97e936
2 changed files with 9 additions and 10 deletions
|
|
@ -66,17 +66,16 @@ export const useParsedContent = (
|
|||
}
|
||||
|
||||
// Highlight code blocks
|
||||
const codeBlocks = contentHtml.querySelectorAll("pre code");
|
||||
/* const codeBlocks = contentHtml.querySelectorAll("pre code");
|
||||
for (const codeBlock of codeBlocks) {
|
||||
const code = codeBlock.textContent;
|
||||
if (!code) {
|
||||
continue;
|
||||
}
|
||||
const newCode = (await getShikiHighlighter()).highlight(code, {
|
||||
lang: codeBlock
|
||||
.getAttribute("class")
|
||||
?.replace("language-", ""),
|
||||
});
|
||||
|
||||
const highligher = await getShikiHighlighter();
|
||||
|
||||
const newCode = highligher.highlight(code, {});
|
||||
|
||||
// Replace parent pre tag with highlighted code
|
||||
const parent = codeBlock.parentElement;
|
||||
|
|
@ -84,7 +83,7 @@ export const useParsedContent = (
|
|||
continue;
|
||||
}
|
||||
parent.outerHTML = newCode;
|
||||
}
|
||||
}*/
|
||||
|
||||
result.value = contentHtml.innerHTML;
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue