prechoster icon indicating copy to clipboard operation
prechoster copied to clipboard

can’t put < in a code block with style inliner or svelte

Open delan opened this issue 2 years ago • 1 comments

html only (htmlonly.txt):

image

html and style inliner (styleinliner.txt):

image

svelte (svelte.txt):

image

thanks for making prechoster!

delan avatar Oct 11 '23 02:10 delan

hmm yeah this is a side effect of how markdown is technically not supported by prechoster. Markdown gets passed through fine most of the time, but e.g. the DOMParser used in the style inliner does some liberal transformations on the input HTML that would be valid for HTML but not for markdown. I don’t think there’s much I can do about that tbh (but i am open to ideas since i have run into this myself also)

I can at least offer workarounds. you can either concede and use <pre> and &lt; instead of markdown code blocks, or alternatively, make use multiple inputs: image since html only works fine (as above), you can extract the markdown code block into a separate module and then send it directly to the output without any transformations. this lets you keep the style inliner for other stuff, and they’ll all appear in the output document in numbering order. it’s a bit cumbersome, but it works, i suppose

cpsdqs avatar Oct 14 '23 06:10 cpsdqs