mirror of
https://github.com/futurepress/epub.js.git
synced 2025-10-04 15:09:16 +02:00
Parse nxcItem with namespace
Some Ncx files have a namespace. A normal navpoint looks like this: ``` <navPoint id="id3" playOrder="3"> ``` But a namespaced navPoint looks like this: ``` <ncx:navPoint id="id3" playOrder="3"> ``` This change will remove the namespace of the nodeName. This way we'll get a properly nested TOC.
This commit is contained in:
parent
96141d1de3
commit
6333d008fe
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ class Navigation {
|
|||
parentNode = item.parentNode,
|
||||
parent;
|
||||
|
||||
if(parentNode && parentNode.nodeName === "navPoint") {
|
||||
if(parentNode && (parentNode.nodeName === "navPoint" || parentNode.nodeName.split(':').slice(-1)[0] === "navPoint")) {
|
||||
parent = parentNode.getAttribute("id");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue