readium / SDKLauncher-iOS

A small iOS application to serve as a launcher/testbed for the Readium SDK.
BSD 3-Clause "New" or "Revised" License
71 stars 47 forks source link

Footnotes with elementCfi containing square brackets do not navigate to correct page #93

Closed nimisis closed 7 years ago

nimisis commented 7 years ago

This issue is a Bug

When clicking on a footnote number, I would expect to navigate to the page containing the note, but instead I am taken to another page.

This seems to only happen with footnotes containing an elementCfi with square brackets. Attached is an epub with such footnotes. james.epub.zip

This happens in most recent SDKLauncher-iOS master branch.

nimisis commented 7 years ago

I had thought that all footnotes exhibit the bug, but have noticed that some aren't, so a specific example in the epub above is in section 1.1 Greco-Roman Background, clicking footnote 4 in the middle of the first sentence does not take me to the right place. Seems that getNormalizedRectangles in cfi_navigation_logic.js gives a different value in "master" branch than, say, "feature/popupFootnotes" branch.

danielweck commented 7 years ago

The feature/popupFootnotes branches provide an experimental implementation for ReadiumJS mainly (web/cloud reader and Chrome app), although there is some common code in readium-shared-js which could also be used for native apps.

https://github.com/readium/readium-js-viewer/tree/feature/popupFootnotes + https://github.com/readium/readium-js-viewer/pull/505

https://github.com/readium/readium-shared-js/tree/feature/popupFootnotes + https://github.com/readium/readium-shared-js/pull/270

Also note that the feature/popupFootnotes branches probably need to be updated, i.e. synch'ed (git merge) with their respective develop branches.

danielweck commented 7 years ago

Thanks for sharing a test EPUB, I will take a look at it.

danielweck commented 7 years ago

I have just quickly tried james.epub with iBooks on OSX, the footnotes are not popup ones (they are basic hyperlinks, with no special epub:type="footnote" behaviour).

However, the links fail to reach the correct location with ReadiumJS (which probably impacts native apps too, as the linking engine is in readium-shared-js). To reproduce, open the regular cloud reader (built from the develop branch) at https://readium.firebaseapp.com ...and drag+drop the EPUB file onto the web browser window. (james.epub is full of footnotes, so just open any chapter and click on the first superscript hyperlink you see) I tested on OSX, Safari and Chrome.

danielweck commented 7 years ago

CC @JCCR

nimisis commented 7 years ago

FYI this now works with the latest commit from the master branch of readium-shared-js.

rkwright commented 7 years ago

Closing as fixed