kramdown icon indicating copy to clipboard operation
kramdown copied to clipboard

<figcaption markdown="1"> escapes closing tags after backticks...

Open codingthat opened this issue 2 years ago • 0 comments

Hi everyone! Thanks for developing the lovely kramdown tech. :)

I'm trying to include some kramdown within a <figcaption> element, because nesting it within a kramdown'd <figure> isn't sufficient:

<figure markdown="1">

~~~ cs
// some code here
~~~

<figcaption>My Caption With Inline `BackTicks`</figcaption>
</figure>

This renders as:

image

But if we add markdown="1":

<figure markdown="1">

~~~ cs
// some code here
~~~

<figcaption markdown="1">My Caption With Inline `BackTicks`</figcaption>
</figure>

...something breaks, as it doesn't seem to close off either element correctly:

image

Turns out it's because it's escaping the closing tags for some reason:

<figcaption>
    <p>My Caption With Inline <code>BackTicks</code>&lt;/figcaption&gt;
&lt;/figure&gt;</p>

Now, I thought it might be because it's two markdown="1" elements nested within each other, but if I use div and span instead of figure and figcaption, it works fine:

<div markdown="1">

~~~ cs
// some code here
~~~

<span markdown="1">My Caption With Inline `BackTicks`</span>
</div>

image

So it's specific to figcaption.

codingthat avatar May 30 '22 09:05 codingthat