Second occurrence of inline expansion footnote cannot be expanded

AI-generated summary

The discussion revolves around an issue with the footnote plugin in Discourse, where the second occurrence of an inline expansion footnote cannot be expanded. alxsal first reported the issue, providing a minimal example to reproduce it.

simon was able to reproduce the issue on their local dev site, finding that the second footnote is positioned off the page or at the bottom of the page. They also discovered that inserting a unique footnote between the duplicate footnotes causes the second duplicate footnote to display the content of the unique footnote.

jbrains encountered the same issue and provided an example markup that demonstrates the problem. They later realized that the Discourse instance they were using didn’t have the footnote plugin enabled, and were looking for guidance on how to resolve the issue.

sam suggested that the issue might be related to the underlying markdown-it and markdown-it-footnote libraries, and recommended checking if the issue is already fixed in the latest release.

jbrains investigated further, confirming that the issue is not with the markdown-it and markdown-it-footnote libraries, but rather with how Discourse handles footnotes. They provided a video demonstrating the problem and are seeking help to resolve it.

Using the footnote plugin v0.1 with settings “enable markdown footnotes” and “display footnotes inline” enabled on discourse 2.6.0 beta6 (66ecefba52) :

  • when the same inline footnote is used 2 times in a post, the first one can be clicked and expands to show the footnote, but the second does not (nor does the third…).
  • reproduced on my site with the minimal example provided on the Discourse footnote post :

We are our choices. [1]
A lot of interesting words
He really said it. [1:1]

  • Tried to reproduce on try.discourse.org but the footnote plugin does not seem available

Can someone reproduce as well or is there a problem with my site ?


  1. We are our choices.
    Sartre, some time
    some day
    in the past ↩︎ ↩︎

1 Like

I’ve tested that example on my local dev site (running the latest Discourse code with the Chrome browser.) I’m finding that the second footnote is positioned either at the bottom of the page, or off the page.

If I try inserting a unique footnote between the two duplicate footnotes, the second of the duplicate footnotes will display the content of the unique footnote if it is clicked after having clicked the unique footnote. Example markup for that issue:

We are our choices. [^sartre]

A lot of interesting words

Second footnote test [^second]

He really said it. [^sartre]

[^sartre]: We are our choices.
Sartre, some time
some day
in the past

[^second]: this is the content of the second footnote

2 Likes

I ran into this today, by trying to be humorous.[1]


  1. You can read this, but you can’t expand this[2]. ↩︎

  2. What a pity! This is hilarious. ↩︎

I guess this Discourse doesn’t use the footnote plugin.

So… I infer that it’s up to me if I want this to work. Is that so? Can anyone give me a leg up?

First step is figuring out if it works here:

https://github.com/markdown-it/markdown-it-footnote

We are simply repackaging it, it is possible it is already improved in the latest release.

1 Like

I finally had time to look into this. Thank you for the suggestion.

markdown-it and markdown-it-footnote behave as I’d expect. I confirmed this with some simple unit tests.

The problem seems to arise when I try to click on the footnote in a topic. Here is what it’s like for me.

First, I try to click the “…” in the nested footnote, which reloads the page; then I try to click the “[2]” link in the nested footnote, for which there is no corresponding HTML anchor.

What can I do about this?

Many thanks.

1 Like