Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function highlight ({ value, lang }, cls, highlighter) {
const index = languages.findIndex((x) => x === lang)
const theme = shiki.getTheme('nord')
if (index >= 0) {
return highlighter.codeToHtml(value, lang)
}
// Fallback for unknown languages.
return `<code style="background: ${theme.bg}; color: ${theme.colors['terminal.foreground']}" class="${cls}">${escape(value)}</code>`
}