Text-run paragraphs miss the synthetic paragraph carrier reset
メンテナーはふだん 1 日以内に返信
関連するプルリクエストがすでにマージされています。
- #2810 @chubes4 による — マージ済み
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
調査の方向性
HtmlCompilation::convertText() から始めてください。ここでソーステキストノード用の有効性キャリアである core/paragraph が作られています。次に createBlock() を確認してください。このメソッドは、コンテンツに class= が含まれる場合にのみ SYNTHETIC_PARAGRAPH_CLASS を追加します。EngineSupportCss が詳細度ゼロのキャリアリセットをどのように適用しているかも確認してください。Issue の再現手順を実行し、.author の行の高さが 28px であることを確かめてください。プレーンテキストのランに合成段落クラスが付与され、再現結果がソースの高さと一致すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Problem
Bare text inside a lowered container (<div class="author">Anonyme</div>) becomes a plain <p> with no blocks-engine-synthetic-paragraph class. That paragraph has no source box, but it renders with the UA paragraph margins of 1em top and bottom.
Reproduction (neutral)
<style>.review{display:flex;flex-direction:column}.author{font-weight:600;margin-top:16px}</style>
<main><div class="review"><p class="body">Quote text here.</p><div class="author primary">Anonyme</div></div></main>
Output: <div class="wp-block-group author primary …"><p>Anonyme</p></div>. In the source, .author is 28px tall; in the import it is 60px tall, because of the 16px UA margin above and below the paragraph.
On a real capture (nostar2.com reviews carousel), every slide's author line grows 32px. The section and everything below it drift 32px.
Root cause
HtmlCompilation::convertText() builds the validity-carrier core/paragraph for a source text node. createBlock() adds SYNTHETIC_PARAGRAPH_CLASS to source-less paragraphs only when their content contains class= (styled inline leaves). Plain text runs never get the class, so EngineSupportCss's zero-specificity carrier reset (margin:0, display:contents) doesn't apply to them.
Expected
Every paragraph convertText() synthesizes for a source text run is marked as a synthetic paragraph. The text then renders in its parent's box, exactly as in the source.
AI disclosure: found and reduced with Claude (Anthropic) in the Pi coding agent during the nostar2.com import parity loop.
- 主要言語
- PHP
- スター
- 25
- フォーク
- 3
- 平均マージ
- 2時間 29分
- マージ済み PR(30日)
- 931
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Automattic/blocks-engine のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Automattic/blocks-engine#5003 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/blocks-engine#4943 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Automattic/blocks-engine#4942 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
Automattic/blocks-engine#4921 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
Automattic/blocks-engine#775 ·
メンテナーはふだん 1 日以内に返信
Automattic/blocks-engine の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
shukiv/jabali-panel#2423 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
-
customer-reported enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
MagnaCapax/PMSS#1252 ·
メンテナーはふだん 3 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 79/100
smarty-php/smarty#1220 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
StarCitizenWiki/mediawiki-extensions-EmbedVideo#224 · コメント 1 件 ·