Skip to content

Conversation

@bill-titus
Copy link
Contributor

A fix is needed in two places.
1.) packaging.js -> use "children" to find only elements rather than "childNode" which can sometimes return text nodes and comment nodes, depending on the format of package.opf.
2.) epubcfi.js -> multiple the spine index by 2 to conform to CFI rules.

NOTE: The existing code works due to these two bugs canceling each other out for cases when the package.opf is formatted with spacing and no comments (and hence including two nodes for every one element in the spine).

A fix is needed in two places.
1.) packaging.js -> use "children" to find only elements rather than "childNode" which can sometimes return text nodes and comment nodes, depending on the format of package.opf.
2.) epubcfi.js -> multiple the spine index by 2 to conform to CFI rules.

NOTE: The existing code works due to these two bugs canceling each other out for cases when the package.opf is formatted with spacing and no comments (and hence including two nodes for every one element in the spine).
@fchasen
Copy link
Contributor

fchasen commented Mar 29, 2017

This all looks good, thanks for tracking the issue down.

@fchasen fchasen merged commit 646a09a into futurepress:v0.3 Mar 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants