Move markdown to molecules
parent
7a254da0ae
commit
20edd1b562
@ -1,13 +0,0 @@
|
||||
<script lang="ts">
|
||||
import { marked } from "marked";
|
||||
|
||||
type Props = {
|
||||
markdown: string;
|
||||
};
|
||||
|
||||
const { markdown }: Props = $props();
|
||||
|
||||
const markdownHtml = marked(markdown);
|
||||
</script>
|
||||
|
||||
{@html markdownHtml}
|
@ -1,20 +1,22 @@
|
||||
<script lang="ts">
|
||||
import type { Snippet } from "svelte";
|
||||
import { marked } from "marked";
|
||||
|
||||
type Props = {
|
||||
children: Snippet;
|
||||
markdown: string;
|
||||
};
|
||||
|
||||
const { children }: Props = $props();
|
||||
const { markdown }: Props = $props();
|
||||
|
||||
const markdownHtml = marked(markdown);
|
||||
</script>
|
||||
|
||||
<div class="paragraph">
|
||||
{@render children()}
|
||||
<div class="markdown">
|
||||
{@html markdownHtml}
|
||||
</div>
|
||||
|
||||
<style lang="scss">
|
||||
@layer component {
|
||||
.paragraph {
|
||||
.markdown {
|
||||
font-family: var(--font-readable);
|
||||
hyphens: auto;
|
||||
text-align: justify;
|
Loading…
Reference in New Issue