zerodevx / zero-md

Ridiculously simple zero-config markdown displayer
https://zerodevx.github.io/zero-md/
ISC License
437 stars 48 forks source link

HTML code block not working correctly #75

Closed a-was closed 1 year ago

a-was commented 1 year ago

I'm trying to display inline markdown with html code blocks inside for some of my documentation like this:

<zero-md>
    <script type="text/markdown">
    some docs...

    ```html
    <script type="text/javascript" src="..."></script>
</script>



But inner closing script tag is working, I mean zero-md ends with it. I tried to escape this tag in many different ways, but I only end with not valid tag like `\<script\>` or `&lt;` displayed

Could this be handled in some way?
zerodevx commented 1 year ago

Make sure there's no indentation in your inline markdown.

<zero-md>
    <script type="text/markdown">
some docs...

```html
<script type="text/javascript" src="..."></script>
</script>

a-was commented 1 year ago

Actually, I tried this at first, then added indentation. Both works the same (zero-md ends)

zerodevx commented 1 year ago

I don't think there's a workaround. The browser parser treats the first </script> closing tag it encounters as the end of script. Alternatively, load your markdown from an external file instead.

a-was commented 1 year ago

Okay, thanks for help