Parse <nav> elements nested in other HTML elements in EPUB 3 navigation documents #113
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Parse
<nav>
elements nested in other HTML elements in EPUB 3 navigation documentsThis is:
Related issue: #106
Description
When EpubReader parses a EPUB 3 navigation file, it expects to find a
<nav epub:type="toc">
element among the children of the<body>
element. However, if the<nav>
element is wrapped in another HTML element (e.g.<div>
), EpubReader won't be able to find it. The EPUB 3 specification doesn't specify whether<nav>
elements can be wrapped in other elements, but since it doesn't prohibit it, EpubReader should support this case.This pull request adds a recursive search for all
<nav>
elements within the EPUB 3 navigation file.Testing steps
<nav>
element is wrapped in a<div>
.Epub3NavDocumentReaderTests.ReadEpub3NavDocumentAsyncWithNonTopLevelNavElementTest
).