readium / kotlin-toolkit

A toolkit for ebooks, audiobooks and comics written in Kotlin
https://readium.org/kotlin-toolkit
BSD 3-Clause "New" or "Revised" License
163 stars 72 forks source link

Fix handling EPUB `noteref` with nested elements #503

Closed mickael-menu closed 2 months ago

mickael-menu commented 2 months ago

EPUB noteref links containing nested HTML elements were not always reported as footnotes, as we were checking the epub:type="noteref" attribute on the targetElement, which might not be the <a>.

For example with <a epub:type="noteref" href="notas.xhtml#nt1" id="rf1"><sup>1</sup></a>.</p>,

interactiveElement is the whole <a>, while targetElement might be <sup>1</sup>, depending where we clicked.