Some EPUB converters emit invalid block-in-inline markup — block elements nested inside inline elements, often deeply:
<span><span id="...">
<div class="title">…</div>
<div class="epigraph">…</div>
<p>body text…</p>
</span></span>
With such files the built-in reflowable engine renders only the chapter titles and epigraphs; all body paragraphs are silently dropped. (Reproducible with EPUBs produced by the royallib.com converter.)
Analysis: has_blocks in document/html/engine.rs only checks direct children for block elements. wrap_lost_inlines wraps the consecutive inline spans into an anonymous wrapper whose children are all inline, so the engine takes the inline path, and gather_inline_material flattens the nested <div>/<p> blocks into a single inline run — their content never produces lines.
Browsers handle this case by promoting the inline ancestors / splitting them around the blocks (CSS 2.1 §9.2.1.1), so the books display fine everywhere else, which makes the failure look like a Plato bug rather than a broken book.
I have a small self-contained fix (promote inline elements with block descendants to blocks before wrapping lost inlines) — PR incoming.
Some EPUB converters emit invalid block-in-inline markup — block elements nested inside inline elements, often deeply:
With such files the built-in reflowable engine renders only the chapter titles and epigraphs; all body paragraphs are silently dropped. (Reproducible with EPUBs produced by the royallib.com converter.)
Analysis:
has_blocksindocument/html/engine.rsonly checks direct children for block elements.wrap_lost_inlineswraps the consecutive inline spans into an anonymous wrapper whose children are all inline, so the engine takes the inline path, andgather_inline_materialflattens the nested<div>/<p>blocks into a single inline run — their content never produces lines.Browsers handle this case by promoting the inline ancestors / splitting them around the blocks (CSS 2.1 §9.2.1.1), so the books display fine everywhere else, which makes the failure look like a Plato bug rather than a broken book.
I have a small self-contained fix (promote inline elements with block descendants to blocks before wrapping lost inlines) — PR incoming.