Skip to content
This repository was archived by the owner on May 7, 2025. It is now read-only.

CFIs break when a text node has a comment. #49

@matwood

Description

@matwood
<p class="normal text"><!--Node -->Lorem ipsum.</p>

The above is an example line that trips up Readium CFIs. When trying to load a CFI the node picked is the comment, but the offset is still the text after the comment. This leads to an index out of bounds error.

this.interpretLocalPath splits the element and returns the comment element first. I think the CFI load code should ignore the comment node based on the CFI spec here:

http://www.idpf.org/epub/linking/cfi/epub-cfi.html#sec-path-child-ref

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions