format markdown images
This commit is contained in:
parent
c3d3fc3b00
commit
1d172dabac
2 changed files with 11 additions and 1 deletions
9
src/lib/components/markdown/Image.svelte
Normal file
9
src/lib/components/markdown/Image.svelte
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
<script lang="ts">
|
||||||
|
import type { SvelteHTMLElements } from 'svelte/elements';
|
||||||
|
|
||||||
|
type Props = Omit<SvelteHTMLElements['img'], 'class'>;
|
||||||
|
|
||||||
|
const { ...restProps }: Props = $props();
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<img {...restProps} class="mx-auto rounded-lg object-cover" />
|
||||||
|
|
@ -7,12 +7,13 @@
|
||||||
import h3 from '$lib/components/markdown/Heading3.svelte';
|
import h3 from '$lib/components/markdown/Heading3.svelte';
|
||||||
import h4 from '$lib/components/markdown/Heading4.svelte';
|
import h4 from '$lib/components/markdown/Heading4.svelte';
|
||||||
import h5 from '$lib/components/markdown/Heading5.svelte';
|
import h5 from '$lib/components/markdown/Heading5.svelte';
|
||||||
|
import img from '$lib/components/markdown/Image.svelte';
|
||||||
import p from '$lib/components/markdown/Paragraph.svelte';
|
import p from '$lib/components/markdown/Paragraph.svelte';
|
||||||
import pre from '$lib/components/markdown/Pre.svelte';
|
import pre from '$lib/components/markdown/Pre.svelte';
|
||||||
import ol from '$lib/components/markdown/OrderedListItem.svelte';
|
import ol from '$lib/components/markdown/OrderedListItem.svelte';
|
||||||
import ul from '$lib/components/markdown/UnorderedList.svelte';
|
import ul from '$lib/components/markdown/UnorderedList.svelte';
|
||||||
|
|
||||||
export { a, blockquote, code, h1, h2, h3, h4, h5, p, pre, ol, ul };
|
export { a, blockquote, code, h1, h2, h3, h4, h5, img, p, pre, ol, ul };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<slot />
|
<slot />
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue