Revision 57d704e8ca05108db3526b7181d70fa33add3519 authored by Cameron Yick on 13 December 2023, 03:03:53 UTC, committed by GitHub on 13 December 2023, 03:03:53 UTC
1 parent 15c5356
Raw File
Highlight.svelte
<script lang="ts">
  import 'svelte-highlight/src/styles/github.css';
  import xml from 'svelte-highlight/src/languages/xml';
  import json from 'svelte-highlight/src/languages/json';
  import js from 'svelte-highlight/src/languages/javascript';
  import ts from 'svelte-highlight/src/languages/typescript';
  import py from 'svelte-highlight/src/languages/python';
  import yaml from 'svelte-highlight/src/languages/yaml';
  import 'svelte-highlight/src/styles/github.css';
  const langSupport = {xml, js, json, ts, ac: json, py, yaml, xsl: xml};
  import {Highlight} from 'svelte-highlight';

  export let code: string | null;
  export let fileType: string | null;
</script>

<Highlight language={langSupport[fileType.toLowerCase()]} {code} />
back to top