lemonmade / bigfoot

A jQuery plugin for creating exceptional footnotes.
http://www.bigfootjs.com
MIT License
936 stars 69 forks source link

Nested footnotes don't work #53

Open dechamps opened 8 years ago

dechamps commented 8 years ago

Bigfoot version: 2.1.4

Steps to reproduce

<link rel="stylesheet" href="https://rawgit.com/lemonmade/bigfoot/2.1.4/dist/bigfoot-default.css" type="text/css">
<script src="https://code.jquery.com/jquery-1.12.3.js"></script>
<script type="text/javascript" src="https://rawgit.com/lemonmade/bigfoot/2.1.4/dist/bigfoot.js"></script>
<script type="text/javascript">$.bigfoot();</script>
<p>Link to outer footnote: <sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>
<div class="footnotes"><ol>
    <li class="footnote" id="fn:1"><p>
        This is the outer footnote.
        It contains a link to another footnote: <sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup>
        <a href="#fnref:1" title="return to article"> R</a>
    </p></li>
    <li class="footnote" id="fn:2"><p>
        This is the inner footnote.
        <a href="#fnref:2" title="return to article"> R</a>
    </p></li>
</ol></div>

Expected result

Bigfoot should process both footnotes. The inner footnote should be available as a clickable button in the text of the outer footnote.

Actual result

Bigfoot only seems to process the outer footnote. The inner footnote is left untouched and is not converted to a clickable button with popover text.

I don't think this use case is unreasonable - I use footnotes for tangents and for references, and I sometimes feel the need to include a reference inside a tangent.

lemonmade commented 8 years ago

I don't see how this can work well when the content of the outer footnote is read as part of the footnote popover when clicked in the main text. Should you get a popover coming out from another popover? I think this is probably bad UX and also introduces technical problems given the overflows that need to be set on the footnote popover itself. It also introduces the potential for an infinitely recursive case (footnote 1 references footnote 2, which references footnote 1).