Icon-only links named by aria-label are silently dropped by HtmlTransformer

オープン
#6,015 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
66/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php
領域
tooling

調査の方向性

Start at the HtmlTransformer entry point and locate its existing transformation tests. Trace how links with no text content are handled, then add neutral fixtures for icon-only links in a list item and a paragraph. Done when each control preserves its href and accessible name, or the run emits a named diagnostic.

索引モデルが issue の本文から書いたものです。

説明

Summary

HtmlTransformer drops a link whose only content is an icon element named through aria-label. The interactive control disappears silently: there is no text, so content conservation reports no loss, and no fallback diagnostic is emitted either.

Reproduction

(new HtmlTransformer())->transform('<ul class="pager"><li><a href="/journal/page/2/">2</a></li><li><a href="/journal/page/2/"><span class="icon icon-chevron-right" role="img" aria-label="Next" title="Next"></span></a></li></ul>')->toArray()['serialized_blocks'];

The output keeps only the 2 list item. The Next control and its list item are gone. The result is the same with or without an icon-font class on the span.

Real-world impact

On a captured Odoo blog listing, the pager's previous/next chevrons (<span class="oi oi-chevron-left|right" role="img" aria-label="Previous|Next">) vanish from the imported page. Only numbered links remain.

Expected

A link with an accessible name keeps its control. One option: preserve the icon element with its accessible name, for example as an icon-bearing link in rich text, with aria-label kept. If that is not representable, report an explicit diagnostic instead of dropping the control silently. When nothing else in the control carries text, conservation should treat the link's accessible name as text that must survive.

Acceptance

A neutral fixture covering an icon-only link inside a list item and in a paragraph. The control survives with its href and accessible name, or the run emits a named diagnostic.


Investigated and drafted by Claude Opus (Claude Code via Roadie) from a real import run.

主要言語
PHP
スター
28
フォーク
5
平均マージ
2時間 59分
マージ済み PR(30日)
942

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/blocks-engine のほかの issue

Automattic/blocks-engine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。