mirror of
https://github.com/morgan9e/chatgpt-web
synced 2026-04-14 00:14:04 +09:00
Switch to svelte-markdown
This commit is contained in:
23
src/lib/Code.svelte
Normal file
23
src/lib/Code.svelte
Normal file
@@ -0,0 +1,23 @@
|
||||
<script lang="ts">
|
||||
// Disabled for now - it blows up the size too much
|
||||
import { HighlightAuto } from "svelte-highlight";
|
||||
import style from "svelte-highlight/styles/edge-light";
|
||||
|
||||
export let type: "code";
|
||||
export let raw: string;
|
||||
export let codeBlockStyle: "indented" | undefined = undefined;
|
||||
export let lang: string | undefined = undefined;
|
||||
export let text: string;
|
||||
|
||||
// Disable warnings
|
||||
type = "code";
|
||||
raw;
|
||||
codeBlockStyle;
|
||||
lang;
|
||||
</script>
|
||||
|
||||
<svelte:head>
|
||||
{@html style}
|
||||
</svelte:head>
|
||||
|
||||
<HighlightAuto code={text} />
|
||||
Reference in New Issue
Block a user