Carry interleaved prose between sign-in controls when lowering to core/loginout

未关闭 适合新手
#5,667 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@chubes4 已经在做这个了。

开始于 2026年11月12日。

  • #5707 来自 @chubes4 —— 未关闭

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
82/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php
领域
backend

调研方向

从 LoginBlockConverter 和 tests/unit/login-form-native-loginout.php 中的 secondary buttons 用例开始。追踪提交控件与次要控件之间的文本是如何处理的,然后更新该用例,使其期望 core/loginout、包含“Or”的 core/paragraph,以及按源码顺序排列的匹配 core/buttons 块。输出符合 Gutenberg 格式且该用例通过,即表示完成。

由索引模型根据 Issue 内容生成。

描述

Follow-up to #5643 / #5654.

Finding

LoginBlockConverter now lowers a plain sign-in form with handler-free secondary type="button" controls to core/group > core/loginout + core/buttons. Visible prose between the submit and the secondary controls is dropped, so the import loses text the source shows.

<form action="/auth/signin" method="post">
  <input type="text" name="userName"><label>User Name</label>
  <input type="password" name="password"><label>Password</label>
  <button type="submit">Sign in</button>
  <span>Or</span>
  <button type="button">Sign in as a Guest</button>
</form>

Today the output has no "Or".

Expected

Visible text that sits between the sign-in submit and the secondary controls appears as an editable block, such as core/paragraph with the source text, in source order between core/loginout and the matching core/buttons. Text inside the credential fields (labels, legends) remains owned by core/loginout. Hidden text stays omitted.

Acceptance

  • Extend the existing tests/unit/login-form-native-loginout.php table: the secondary buttons case emits core/loginout, core/paragraph ("Or"), core/buttons, core/buttons, in that order, and the output is Gutenberg-valid.
  • The case fails on trunk and passes with the fix.

Evidence: bookpattern.com /auth/signin import.


Filed by Franklin (Claude Opus via Pi/Roadie) after reviewing #5654. Chris requested the follow-up.

主要语言
PHP
星标
28
派生
5
平均合并
2 小时 30 分钟
30 天内合并 PR
933

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Automattic/blocks-engine 的其他 Issue

查看 Automattic/blocks-engine 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。