diff --git a/src/dom/epub/epub-view.ts b/src/dom/epub/epub-view.ts index e4a64867..5aff68ed 100644 --- a/src/dom/epub/epub-view.ts +++ b/src/dom/epub/epub-view.ts @@ -161,7 +161,7 @@ class EPUBView extends DOMView { this._iframeDocument.body.append(this._sectionsContainer); let styleScoper = new StyleScoper(this._iframeDocument); - await Promise.all(this.book.spine.spineItems.map(section => this._displaySection(section, styleScoper))); + await this._displaySections(styleScoper); if (this._sectionRenderers.some(view => view.error) && await this._isEncrypted()) { this._options.onEPUBEncrypted(); @@ -244,6 +244,14 @@ class EPUBView extends DOMView { this._sectionRenderers[section.index] = renderer; } + private _displaySections(styleScoper: StyleScoper) { + return Promise.all(this.book.spine.spineItems + // We should do this: + // .filter(section => section.linear) + // But we need to be sure it won't break anything + .map(section => this._displaySection(section, styleScoper))); + } + private _initPageMapping(json?: string): PageMapping { let mapping: PageMapping | null = null;