Text-run paragraphs miss the synthetic paragraph carrier reset
Maintainers usually reply within 1 day
A pull request for this has already been merged.
- #2810 by @chubes4 — merged
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in HtmlCompilation::convertText(), where the validity-carrier core/paragraph is built for source text nodes, then look at createBlock(), which adds SYNTHETIC_PARAGRAPH_CLASS only when content contains class=. Check how EngineSupportCss applies its zero-specificity carrier reset. Run the reproduction in the issue and confirm the .author line is 28px tall. Done when plain text runs get the synthetic paragraph class and the reproduction matches the source height.
Written by the indexing model from the issue text.
Description
Problem
Bare text inside a lowered container (<div class="author">Anonyme</div>) becomes a plain <p> with no blocks-engine-synthetic-paragraph class. That paragraph has no source box, but it renders with the UA paragraph margins of 1em top and bottom.
Reproduction (neutral)
<style>.review{display:flex;flex-direction:column}.author{font-weight:600;margin-top:16px}</style>
<main><div class="review"><p class="body">Quote text here.</p><div class="author primary">Anonyme</div></div></main>
Output: <div class="wp-block-group author primary …"><p>Anonyme</p></div>. In the source, .author is 28px tall; in the import it is 60px tall, because of the 16px UA margin above and below the paragraph.
On a real capture (nostar2.com reviews carousel), every slide's author line grows 32px. The section and everything below it drift 32px.
Root cause
HtmlCompilation::convertText() builds the validity-carrier core/paragraph for a source text node. createBlock() adds SYNTHETIC_PARAGRAPH_CLASS to source-less paragraphs only when their content contains class= (styled inline leaves). Plain text runs never get the class, so EngineSupportCss's zero-specificity carrier reset (margin:0, display:contents) doesn't apply to them.
Expected
Every paragraph convertText() synthesizes for a source text run is marked as a synthetic paragraph. The text then renders in its parent's box, exactly as in the source.
AI disclosure: found and reduced with Claude (Anthropic) in the Pi coding agent during the nostar2.com import parity loop.
- Dominant language
- PHP
- Stars
- 21
- Forks
- 2
- Avg merge
- 8h 19m
- Merged PRs (30d)
- 679
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Automattic/blocks-engine
-
Solved site promotion gate fails on runner PHP patch drift (expects 8.2.33, runner installs 8.2.34)Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#2161 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Automattic/blocks-engine#2061 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Automattic/blocks-engine#1701 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Automattic/blocks-engine#775 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Automattic/blocks-engine#2987 ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Featured image not passed to checks in the Tasks column or publish blocksPossibly taken @roborourke claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
humanmade/publication-checklist#100 ·
Maintainers usually reply within 1 day
-
bug customer-reported
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
MagnaCapax/PMSS#1072 ·
Maintainers usually reply within 5 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
hestiacp/hestiacp#5800 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 Half a day Newbie friendliness 68/100
components-web-app/docs#244 ·