2

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.

grg
  • 85
  • 7
  • 1
    Footnotes [aren't part](https://daringfireball.net/projects/markdown/syntax) of [Markdown](https://spec.commonmark.org/current/), though some tools have added them. What is the specific Markdown tool that you are using? – ChrisGPT was on strike Nov 02 '21 at 15:48
  • Hello. I am using jekyll with kramdown – grg Nov 02 '21 at 16:06
  • Ok, thanks to your comment, I was able to find the solution. Thanks a lot! The trick was to surround the footnote with

    with the markdown argument: ```

    b[^2]

    ```
    – grg Nov 02 '21 at 16:27
  • 1
    Glad you found a solution. That works in _some_ tools, but not all :-). – ChrisGPT was on strike Nov 02 '21 at 16:37

1 Answers1

3

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.

grg
  • 85
  • 7
  • 2
    Thanks, @grg. I had this challenge with footnotes in an HTML table. In my case, I didn't want a `

    ` tag for styling reasons, so wrapping the text in a `` worked, too.

    – Arthur Aug 18 '22 at 08:25