Presentational <font size> inside a heading is dropped, so the heading renders at its full heading size

Chiusa
#2,942 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
55/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
php, wordpress
Ambito
devtools

Direzione di ricerca

The payload names no source files, so start by finding where the converter handles inline elements, and compare it with the align fix referenced in #2889. Reproduce with a neutral fixture of an h2 containing em and font size="3", and check the converted output for the font-size. Done means that fixture converts to 16px, with color and face covered by tests.

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

Descrizione

Observed

A hosted-builder page marks its form intro as a heading whose text is wrapped in a presentational <font> element:

<h2 class="wsite-content-title"><em><font size="3">We'd appreciate hearing from you! …</font></em></h2>

Browsers render <font size="3"> at 16px, so on the source the intro is small 16px italic text. After conversion (php-transformer v0.43.7), the <font> element and its size are gone. The core/heading renders at the h2 size: 36px at 1440 and 29.25px at 768, against 16px on the source. The text block grows from 62px to 130px tall at 1440, and from 54px to 140px at 768. The retained capture matches the source, so the loss happens during conversion.

This is the same family as #2889 (the presentational align attribute is dropped). Legacy presentational attributes on inline carriers (font[size|color|face]) carry authored typography that has no stylesheet rule to fall back on.

Expected

<font size|color|face> survive as equivalent inline typography on the rich-text run, e.g. a styled mark or carrier with font-size from the HTML size scale (1→10px … 3→16px … 7→48px) and the color and font-family. That lets the heading render at the authored size.

Acceptance

  • A neutral fixture of a heading containing <font size="3"> converts with a computed font-size of 16px (not the heading default).
  • color and face are covered too.

AI disclosure: Pi coding agent (Anthropic model via Roadie) measured this with Playwright and drafted the comment under Chris Huber's direction.

Lingua principale
PHP
Stelle
25
Fork
3
Merge medio
3h 25m
PR unite (30g)
935

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.