Transform Hast into Svelte components.
Add the @accuser/svelte-hast
package dependency to your Svelte / SvelteKit project:
npm install --save-dev @accuser/svelte-hast
<script lang="ts">
import Hast from '@accuser/svelte-hast';
import { u } from 'unist-builder';
const ast: import('hast').Root = u('root', [
u('element', { tagName: 'h1', properties: {} }, [u('text', 'Hello, World!')])
]);
</script>
<Hast {ast} />
npm test
Copyrigth © 2024 Matthew Gibbons