Footnotes in list item #201

Closed
opened 2026-01-29 14:30:15 +00:00 by claunia · 5 comments
Owner

Originally created by @fiz85 on GitHub (Apr 17, 2018).

I want to put a note in an item list but Markdown does not convert it to HTML.

Normal footnote:
normalfootnote

Footnote in list:
footnoteinlist

Thanks for your help!

Originally created by @fiz85 on GitHub (Apr 17, 2018). I want to put a note in an item list but Markdown does not convert it to HTML. **Normal footnote:** ![normalfootnote](https://user-images.githubusercontent.com/38469984/38884361-5fa34fb2-423d-11e8-8abb-c2c4aee7935d.png) **Footnote in list:** ![footnoteinlist](https://user-images.githubusercontent.com/38469984/38884413-89e79198-423d-11e8-9add-e8af12967ce8.png) Thanks for your help!
claunia added the bugPR Welcome! labels 2026-01-29 14:30:15 +00:00
Author
Owner

@xoofx commented on GitHub (Apr 22, 2018):

Could you put a simple text sample here so that we can also see it directly on babelmark?

@xoofx commented on GitHub (Apr 22, 2018): Could you put a simple text sample here so that we can also see it directly on babelmark?
Author
Owner

@fiz85 commented on GitHub (Apr 23, 2018):

Works :
abc
def1

If you put the same items in a list :

  • abc
  • def1

No footnote.


  1. toto ↩︎

@fiz85 commented on GitHub (Apr 23, 2018): **Works :** abc def[^1] [^1]: toto **If you put the same items in a list :** - abc - def[^1] [^1]: toto No footnote.
Author
Owner

@xoofx commented on GitHub (Apr 23, 2018):

Here is the link on babelmark with the footnote not working for a list.

This is indeed a bug. Though currently don't have time to work on it but PR welcome!

@xoofx commented on GitHub (Apr 23, 2018): Here is the [link](https://babelmark.github.io/?text=-+abc%0A-+def%5B%5E1%5D%0A%0A%5B%5E1%5D%3A+Here+is+the+footnote.) on babelmark with the footnote not working for a list. This is indeed a bug. Though currently don't have time to work on it but PR welcome!
Author
Owner

@keith-hall commented on GitHub (Aug 21, 2018):

It seems like the problem is that the block processor doesn't see the list as being closed, so doesn't parse the link definition properly, and thus the inline parser doesn't see the footnote link inside the list as having a valid target and treats it as a literal.

Having the footnote definition before the list works as expected, as does having a block item between the list and the footnote definition.

Unfortunately I'm not familiar enough with markdig's internals yet to see the clear best way to fix this, but if someone can give some pointers I'll happily raise a PR.

@keith-hall commented on GitHub (Aug 21, 2018): It seems like the problem is that the block processor doesn't see the list as being closed, so doesn't parse the link definition properly, and thus the inline parser doesn't see the footnote link inside the list as having a valid target and treats it as a literal. [Having the footnote definition before the list works as expected](https://babelmark.github.io/?text=%5B%5E1%5D%3A+Here+is+the+footnote.%0A%0A-+abc%0A-+def%5B%5E1%5D%0A%0A%0A), as does [having a block item between the list and the footnote definition](https://babelmark.github.io/?text=-+abc%0A-+def%5B%5E1%5D%0A%0A%23+test%0A%0A%5B%5E1%5D%3A+Here+is+the+footnote.). Unfortunately I'm not familiar enough with markdig's internals yet to see the clear best way to fix this, but if someone can give some pointers I'll happily raise a PR.
Author
Owner

@xoofx commented on GitHub (Aug 21, 2018):

It should be fixed by commit 790bff3 and published in 0.15.2+

@xoofx commented on GitHub (Aug 21, 2018): It should be fixed by commit 790bff3 and published in `0.15.2+`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/markdig#201