(code: string, language: string)
| 17 | } |
| 18 | |
| 19 | export function highlightCode(code: string, language: string) { |
| 20 | try { |
| 21 | language = language.toLowerCase(); |
| 22 | const langExists = getLoadedLanguages().includes(language as Lang); |
| 23 | const lang = langExists ? language : "shell"; |
| 24 | |
| 25 | return ( |
| 26 | highlighter.codeToHtml(code, { lang, theme: "one-dark-pro" }) + |
| 27 | highlighter.codeToHtml(code, { lang, theme: "github-light" }) |
| 28 | ); |
| 29 | } catch { |
| 30 | return code; |
| 31 | } |
| 32 | } |
nothing calls this directly
no test coverage detected