mirror of
https://github.com/withastro/astro.git
synced 2024-12-23 21:53:55 -05:00
64432bcb87
* Upgrade @astrojs/prism to a real package, fix component import not working * Remove `@astrojs/prism` as a dependency of `astro` * Update lock file * Refactor to multiple files * Oops, can't have astro imports run inside node * Follow Nate's suggestion on being minors instead of patchs * Update lockfile
16 lines
402 B
Text
16 lines
402 B
Text
---
|
|
import { runHighlighterWithAstro } from './dist/highlighter';
|
|
|
|
export interface Props {
|
|
class?: string;
|
|
lang?: string;
|
|
code: string;
|
|
}
|
|
|
|
const { class: className, lang, code } = Astro.props as Props;
|
|
const { classLanguage, html } = runHighlighterWithAstro(lang, code)
|
|
---
|
|
|
|
<pre class={[className, classLanguage].join(' ')}>
|
|
<code class={classLanguage}><Fragment set:html={html} /></code>
|
|
</pre>
|