pngwn / MDsveX

A markdown preprocessor for Svelte.
https://mdsvex.pngwn.io
MIT License
2.28k stars 96 forks source link

Custom components with HTML tags #314

Open iceghost opened 2 years ago

iceghost commented 2 years ago

Suppose I have a post layout like this:

import H1 from '$lib/H1.svelte';
export { H1 as h1 };

This mdsvex file

---
layout: post
---
# Welcome to SvelteKit
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

works with the replaced custom H1. But this:

---
layout: post
---
<h1>Welcome to SvelteKit</h1>
<p>Visit <a href="https://kit.svelte.dev">kit.svelte.dev</a> to read the documentation</p>

doesn't works. Is this an expected behavior?

Would be nice if this is supported 😀

pngwn commented 2 years ago

This is not supported right now but will be in the future (probably via a flag).