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">
|
<script lang="ts">
|
||||||
import type { Snippet } from "svelte";
|
import { marked } from "marked";
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
children: Snippet;
|
markdown: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const { children }: Props = $props();
|
const { markdown }: Props = $props();
|
||||||
|
|
||||||
|
const markdownHtml = marked(markdown);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="paragraph">
|
<div class="markdown">
|
||||||
{@render children()}
|
{@html markdownHtml}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
@layer component {
|
@layer component {
|
||||||
.paragraph {
|
.markdown {
|
||||||
font-family: var(--font-readable);
|
font-family: var(--font-readable);
|
||||||
hyphens: auto;
|
hyphens: auto;
|
||||||
text-align: justify;
|
text-align: justify;
|
Loading…
Reference in New Issue