detect callouts

This commit is contained in:
Maxime Cannoodt 2022-06-24 18:31:11 +02:00
parent 8c4d92dab7
commit 2d54180a2c
2 changed files with 13 additions and 3 deletions

Binary file not shown.

View File

@ -1,3 +1,13 @@
<p class="border border-l-4 ml-4 prose-p:my-2 prose-p:mx-4">
<script lang="ts">
export let raw: string;
let isCallout = raw.split('\n')[0].match(/>\s?\[!(.+)\]\s(.*) /) != null;
</script>
{#if isCallout}
<p>IS CALLOUT!!</p>
{:else}
<p class="border border-l-4 ml-4 prose-p:my-2 prose-p:mx-4">
<slot />
</p>
</p>
{/if}