hypnagaga/src/components/NoteText/NoteText.svelte
2023-08-31 17:54:34 +05:30

42 lines
783 B
Svelte

<!-- @component `NoteText` [Read the docs.](https://reuters-graphics.github.io/graphics-components/?path=/docs/components-NoteText--default) -->
<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 class="notes">
{#if text}
{@html marked.parse(text)}
{/if}
</Block>
<!-- svelte-ignore css-unused-selector -->
<style lang="scss" global>
@import '../../scss/mixins';
.article-block.notes {
@include fmb-9;
@include fmt-7;
h2,
h3,
h4,
h5,
h6 {
@include h3;
text-transform: none;
}
p {
@include body-note;
@include text-sm;
}
}
</style>