Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Presentational align attribute on block containers is dropped

Aperta
#2,889 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
65/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
html, php
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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.

Lingua principale
PHP
Stelle
21
Fork
2
Merge medio
8h 50m
PR unite (30g)
609

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Automattic/blocks-engine

Tutte le issue di Automattic/blocks-engine

Issue simili

Altre issue su PHP

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.