Skip to content

Commit 1336e51

Browse files
committed
Allow span in toc nav items
According to https://www.w3.org/publishing/epub32/epub-packages.html#sec-package-nav-def-model: "A child `a` element describes the target that the link points to, while a `span` element serves as a heading for breaking down lists into distinct groups (for example, a large list of illustrations can be segmented into several lists, one for each chapter)."
1 parent 228d991 commit 1336e51

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/navigation.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ class Navigation {
191191
*/
192192
navItem(item, parent) {
193193
let id = item.getAttribute("id") || undefined;
194-
let content = filterChildren(item, "a", true);
194+
let content = filterChildren(item, "a", true)
195+
|| filterChildren(item, "span", true);
195196

196197
if (!content) {
197198
return;

0 commit comments

Comments
 (0)