Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use footnotes in markdown inside html?

I am trying to use footnotes in Markdown, but when I put it inside HTML (<div>) the footnotes won't parse.

Here is the minimal example of the code:

a[^1]

<div> 
b[^2]
</div>

[^1]: I am a footnote
[^2]: I want to be a footnote too.

And it's parsed like this:

enter image description here

I was wondering what is the best way to use footnotes inside <div> blocks. Thanks for your help in advance !

Edit: I am using Jekyll with kramdown.

like image 465
grg Avatar asked Sep 15 '25 08:09

grg


1 Answers

The solution was to surround the footnote in a <p> block with the markdown argument.

<div>
<p markdown="1">
b[^2]
</p>
</div>

[^b]: Now I am a footnote too.

Thanks, Chris, for pointing me in the right direction.

like image 61
grg Avatar answered Sep 16 '25 21:09

grg