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

Presentational align attribute on block containers is dropped

Open
#2,889 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
html, php
Domain
tooling

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 a text-align: justify parent renders centered after conversion.
  • An element whose own author CSS sets text-align keeps 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

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.