Presentational align attribute on block containers is dropped
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 65/100
Research direction
Start with the place where Blocks Engine maps the align attribute, which currently applies only to td and th cells. Check how the mapping is applied to flow containers such as div and p, and how an author text-align is already preserved. Add a fixture with <div align="center"> inside a text-align: justify parent, then confirm the emitted block is centered and that an element with its own text-align keeps that value.
Written by the indexing model from the issue text.
Description
Problem
The legacy presentational align attribute on a block container (<div align="center">) is dropped during conversion. Blocks Engine maps align only on table cells (td/th). Content the source centers through this attribute is therefore rendered with the inherited alignment instead.
<div class="post-body" style="text-align: justify">
<div align="center">
<form action="https://payments.example.test/checkout" method="post">
<input type="hidden" name="cmd" value="give">
<input type="image" src="https://cdn.example.test/give.gif" alt="Give">
</form>
</div>
</div>
Browsers map div[align=center] to text-align: -webkit-center / center. That centers the inline image submit, and block descendants follow it too.
In a Studio import of a captured site built on a hosted site builder, the source page centers a donate button this way (button at x=535 in a 795px column). The import keeps the wrapper (#…wcustomhtml) but with no alignment, so its computed text-align is the parent's justify and the button sits at the column's left edge (x=213).
Expected
align="left|center|right|justify" on a flow container (div, p, headings, etc.) becomes the equivalent text alignment on the emitted block, following the browser's presentational-hint mapping. An author CSS text-align on the element keeps winning, as the cascade requires.
Acceptance
- A neutral fixture
<div align="center"><input type="image" ...></div>inside atext-align: justifyparent renders centered after conversion. - An element whose own author CSS sets
text-alignkeeps that value.
AI disclosure: Claude (Anthropic) via Claude Code investigated and drafted this under Chris Huber's direction; operator-authorized direct fallback outside Homeboy.
- Dominant language
- PHP
- Stars
- 21
- Forks
- 2
- Avg merge
- 8h 35m
- Merged PRs (30d)
- 659
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 42/100
Automattic/blocks-engine#3024 · 1 comment ·
Maintainers usually reply within 1 day
All issues in Automattic/blocks-engine
Similar issues
-
InvoiceSettled is answered 200 when the invoice cannot be re-fetched, so BTCPay never redelivers itOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
btcpayserver/woocommerce-greenfield-plugin#93 ·
Maintainers usually reply within 1 day
-
kind/bug status/triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
🐛 [Bug] Bulk CSV import stores hide_from_combined_view=FALSE as a string, which hides every account from Sent, Junk, Trash and DraftsPossibly taken @exSnake claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
opnsense/core#11052 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 66/100