pngwn / MDsveX

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

Mdsvex HTML stringification produces invalid HTML #559

Open gka opened 6 months ago

gka commented 6 months ago

As the Svelte compiler is pretty strict about invalid HTML (such as <img> tags not being closed) it's getting impossible to use MDsveX in an up-to-date SvelteKit project.

Not sure what HTML stringify algorithm MDsveX is using (probably @starptech/prettyhtml-hast-to-html), but it's not closing image tags. If there's an option like the closeSelfClosing from rehype-stringify it should be used.

I tried using rehype-stringify as via rehypePlugins but it didn't work.

pngwn commented 6 months ago

Do you have an example of the problematic code please.