Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Text-run paragraphs miss the synthetic paragraph carrier reset

Closed Beginner friendly
#2,803 0 comments 0 reactions 0 assignees View on GitHub

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
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php, wordpress
Domain
backend

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

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.