fix(HTML): promote inline elements with block descendants to blocks#588
Draft
OGKevin wants to merge 2 commits into
Draft
fix(HTML): promote inline elements with block descendants to blocks#588OGKevin wants to merge 2 commits into
OGKevin wants to merge 2 commits into
Conversation
3800e97 to
ed55de5
Compare
ed55de5 to
6966582
Compare
6966582 to
524931b
Compare
Owner
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
524931b to
e395f8a
Compare
Change-Id: 7e3d38a0c96bff76e1278d669589601e Change-Id-Short: slwmwrpznqto
Some EPUB converters produce invalid block-in-inline markup, e.g. `<span><div class="title">…</div><p>…</p></span>`. The engine only checks direct children for blocks, so once wrap_lost_inlines wraps such spans, gather_inline_material flattens the nested blocks into a single inline run and body text is silently dropped. Promote any inline element with a block-level descendant to a block before wrapping lost inlines, so its content is laid out normally. - Add `force_block: bool` to `ElementData`; `is_block()` checks it first - Add `promote_blockish_inlines()` on `XmlTree`, called at the start of `wrap_lost_inlines()` - Update `element()` constructor to initialise `force_block: false` - Fix regression test assertion to match space-free DrawCommand tokens Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Change-Id: 202072d24625a472814d6d8137f49584 Change-Id-Short: xzxzsxmxvtxu
e395f8a to
1157152
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Add a test that re-produces baskerville/plato#426 and cherry pick the fix from baskerville/plato#427