Thanks for posting the code online.
So footnotes are OK. With the
aside, one can get pop-up (or inline notes).
As you said, the problem lies with these 5000+ endnotes. They use a "classical" code. As I have only one code example, I can only suppose that they do not link to each corresponding individual endnote paragraph but to the same and-huge-endnote folder.
Code:
Every endnote is wrapped in a:
<p class="endnotes" id="chu0004795">
<span class="strong">
<a href="chapter028.xhtml#ch28-1" id="ch28_1">
If one wishes to target each individual endnote paragraph from each anchor, it seems necessary to rebuild all the links for endnotes.
This seems doable but it's more easily said than done... The code seems to allow it (count and class seems OK) but would probably need to be simplified or cleaned (unified?) using regex.
Also, I know that for over 2000 notes, once the links have been created, one has to split the endnote folder in two or three parts. With 5000 (!), it would be more.
If it was made working, the display of the individual notes numbers in the anchors would probably not be very nice. [4795] really? A bit distracting. We would have to use a smallish font-size...
That's all I can say...