Transforms Markdown source (as a string
) or a Markdown AST into Svelte components.
Note
You probably don't want this - look at mdsvex or svelte-markdown instead.
Add the @accuser/svelte-markdown-provider
package dependency to your Svelte / SvelteKit project:
npm install --save-dev @accuser/svelte-markdown-provider
<script>
import { Markdown } from '@accuser/svelte-markdown-provider';
const source = 'Hello, World!';
</script>
<Markdown {src} />
<script>
import { Markdown } from '@accuser/svelte-markdown-provider';
const ast = {
type: 'root',
children: [{
type: 'paragraph',
children: [{
type: 'text',
value: 'Hello, World!'
}]
}]
};
</script>
<Markdown {ast} />