pablo-abc / svelte-markdown

Markdown parser to svelte components
MIT License
360 stars 50 forks source link

Is it possible to get the output HTML without using the component? e.g. compile() function #77

Open matfantinel opened 1 year ago

matfantinel commented 1 year ago

First of all, thanks for the work on this! I was able to get it all working with some custom renderers on my SvelteKit website and it all works well, when rendering with <SvelteMarkdown />

The things is, I'm also generating a RSS feed (xml file), and would like to have the generated HTML outputted in there as well. However, since the XML is generated in a +server.ts, I don't have access to the SvelteMarkdown component. Still I'd love to have the same output, and not use another library to compile it server side.

Here's how the XML file is generated.

matfantinel commented 1 year ago

For the record, for now I decided to use marked directly, and made a simpler version of the renderers for RSS. This commit has more details