hypnagaga/src/components/NoteText/NoteText.svelte
2022-08-26 13:11:33 +01:00

28 lines
616 B
Svelte

<script lang="ts">
/**
* A markdown text string.
* @type {string}
* @required
*/
export let text: string;
import { marked } from 'marked';
import Block from '../Block/Block.svelte';
</script>
<Block cls="notes mb-4">
{#if text}
{@html marked.parse(text)}
{/if}
</Block>
<!-- svelte-ignore css-unused-selector -->
<style lang="scss" global>
// Same as body text... we probably should unbind these styles from the component
// and import them in the app through a separate scss file.
@import "../../scss/mixins";
div.article-block.notes {
@include note-text;
}
</style>