I was feeling quite proud of myself - I received an academic EPUB containing over 3000 endnotes with the request 'make them work'. Luckily the code was clean and consistent, so job done quite easily with some basic regex.
Today's book also has endnotes. The author has made multiple references in the text to the same endnote. Not just the FIRST time a word occurs, but EVERY time. And some of the endnotes are several pages long.
Whatever I do isn't going to be right, is it?