#set html outputting as a string
1 messages · Page 1 of 1 (latest)
this is the function I'm using, basic Shiki configuration which returns a string
async function formatCode(code) {
return shiki.getHighlighter({
theme: 'nord',
}).then(highlighter => {
return highlighter.codeToHtml(code, { lang: 'html' })
})
}
Tried to reproduce but it works as expected
https://stackblitz.com/edit/github-cvctb9?file=src%2Fpages%2Findex.astro&on=stackblitz