<script lang="ts">
  import { Carta } from "@thetadev/carta-md";

  import { CARTA_CFG } from "./carta";

  export let src: string;
  const carta = new Carta(CARTA_CFG);

  $: rendered = carta.renderSSR(src);
</script>

<div class="carta-viewer carta-theme__default prose">
  <!-- eslint-disable-next-line svelte/no-at-html-tags HTML is sanitized -->
  {@html rendered}
</div>
