Block wrapper (<center>) merged into an inline synthetic paragraph loses its line box and widens layout-table cells
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Start by tracing the HTML conversion that merges the <center> wrapper with its inline child and assigns the synthetic paragraph classes; the issue does not name the responsible files or tests. Use the reduced table fixture to compare the wrapped case with the bare-link case, then run php tests/parity/run.php. Done means the wrapped label keeps a block box and the following image starts on a new line, while the bare-link case stays inline and the parity check passes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
A block-level wrapper around only inline content (here <center><font><a>label</a></font></center>) is merged away during conversion. The resulting core/paragraph takes the inline <font>/<a> as its source element, so it gets blocks-engine-synthetic-paragraph without blocks-engine-source-box-paragraph. The engine rule :where(p.blocks-engine-synthetic-paragraph:not(.blocks-engine-source-box-paragraph)){display:inline} then makes it inline.
In the source, the <center> is a block box, so whatever follows starts on a new line. In WordPress the label's last word shares a line with the following inline content. In layout-table cells, that content is the linked image, whose figure is display:contents with an inline img. The cell's min-content width becomes last word + image, and the auto table widens past its authored width.
Real case: physics.uci.edu /~tritz/ (Blocks Engine trunk 925eabd2b4b).
| Sidebar width | Page scrollWidth at 1440 |
Page scrollWidth at 390 |
|
|---|---|---|---|
| Source | 165px | 1440 (no horizontal scroll) | 925 |
| WordPress | 260px ("Photosynthesis" and the 140px image on one line) | 1541 | 1026 |
Reduced repro
<table border="0" cellspacing="0" cellpadding="0" width="100%"><tbody><tr valign="top"><td width="160"><table border="0" cellspacing="0" cellpadding="10" width="160" bgcolor="#000000"><tbody><tr><td align="center"><center><font color="#FFFFCC"><a href="/psu.html" style="color:#FFFFCC;text-decoration:none">Quantum Biology of Photosynthesis</a></font></center><a href="/psu.html"><img src="/media/psu.jpg" alt="Quantum Biology" border="0" height="128" width="140"></a></td></tr><tr><td align="center"><a href="/mag.html">Magnetic Sense</a></td></tr></tbody></table></td><td><h1>Physical Biology</h1><p>The biological sciences currently undergo a revolution comparable to the revolution in physics in the first half of the 20th century.</p><p>Our group focuses on relating the structure of protein assemblies to their function.</p></td></tr></tbody></table>
Output:
<p class="blocks-engine-synthetic-paragraph blocks-engine-synthetic-anchor-undecorated"><mark …><a href="/psu.html">…
This is followed by <figure class="wp-block-image … blocks-engine-synthetic-image-figure-inline">. The paragraph has no source-box class, so it renders display:inline.
Expected
- A paragraph whose content came from a block-level source wrapper (
center,div,p, and so on) that was merged into its only inline child keeps a block box. Mark itblocks-engine-source-box-paragraph, or otherwise emit the line break the wrapper produced. - Content following it in the same cell (the linked image) starts on its own line, as in the source.
- Truly inline sources (loose text, or a bare
<a>or<font>directly in the cell) keep the current inline behaviour.
Verification
- Unit or contract test with the fixture above: the label paragraph carries
blocks-engine-source-box-paragraph, or renders as a block. A sibling case without<center>(bare<a>plus<img>in the cell) still gets the inline synthetic paragraph. - Parity:
php tests/parity/run.phpshows no regressions. - Rendered check: on the physics.uci.edu import,
/~tritz/hasscrollWidth1440 at a 1440px viewport, and the sidebar is about 165px wide.
- Lingua principale
- PHP
- Stelle
- 31
- Fork
- 7
- Merge medio
- 3h 40m
- PR unite (30g)
- 813
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Automattic/blocks-engine
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#4943 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
Automattic/blocks-engine#4942 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Automattic/blocks-engine#4921 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Automattic/blocks-engine#775 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 12/100
Automattic/blocks-engine#7505 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Automattic/blocks-engine
Issue simili
-
OpenRouter errors returned in a 200 body are thrown as a plain AiExceptionForse già presa Una pull request collegata a questa issue è aperta o già unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
freescout-help-desk/freescout#5844 ·
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
I maintainer di solito rispondono entro 1 giorno
-
Перевод устарел
Difficoltà 2/5 1-2 giorni Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno