2021-04-01 14:16:29 -05:00
|
|
|
---
|
2022-08-02 14:53:18 -05:00
|
|
|
import { runHighlighterWithAstro } from './dist/highlighter';
|
2021-04-01 14:16:29 -05:00
|
|
|
|
2023-07-14 08:57:06 -05:00
|
|
|
interface Props {
|
2021-09-01 14:49:01 -05:00
|
|
|
class?: string;
|
|
|
|
lang?: string;
|
|
|
|
code: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
const { class: className, lang, code } = Astro.props as Props;
|
2022-08-05 23:39:26 -05:00
|
|
|
const { classLanguage, html } = runHighlighterWithAstro(lang, code);
|
2021-04-01 14:16:29 -05:00
|
|
|
---
|
|
|
|
|
2022-08-11 11:01:28 -05:00
|
|
|
<pre
|
|
|
|
class={[className, classLanguage]
|
|
|
|
.filter(Boolean)
|
|
|
|
.join(' ')}><code class={classLanguage} set:html={html} /></pre>
|