`<button>` inside `<select>` closes the select (customizable select)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 78/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 活跃
- 技术栈
- html, javascript, typescript
调研方向
阅读 src/Parser.ts,尤其是 openImpliesClose;issue 指出 button 和 formTags 是原因。检查 parser 测试中与 select 和 button 相关的行为,然后调整处理逻辑并运行相关测试。完成标准是:提供的可自定义 select 示例在 HTML 模式下将 button 和 option 保留在 select 内,同时保留 XML 模式。
由索引模型根据 Issue 内容生成。
描述
The HTML spec now allows <button> (with <selectedcontent>) as the first child of <select> for customizable select (whatwg/html#10548, whatwg/html#10310). htmlparser2 closes the <select> as soon as <button> opens.
import { parseDocument } from "htmlparser2";
import render from "dom-serializer";
render(parseDocument(
"<select><button><selectedcontent></selectedcontent></button><option>A</option></select>"
));
// actual: <select></select><button><selectedcontent></selectedcontent></button><option>A</option>
// expected: <select><button><selectedcontent></selectedcontent></button><option>A</option></select>
Cause: in openImpliesClose, button maps to formTags, which contains select.
Reproduced with htmlparser2 12.0.0 and current master. With xmlMode: true the structure is preserved.
Originally reported downstream in posthtml/posthtml#408.
- 主要语言
- TypeScript
- 星标
- 4.8k
- 派生
- 411
- 平均合并
- 14 小时 58 分钟
- 30 天内合并 PR
- 13
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
fb55/htmlparser2 的其他 Issue
-
XML processing instruction loses its trailing ? since v11, so dom-serializer writes <?xml …>可能已有人在做 @ryanchou1994 于 14 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 66/100
fb55/htmlparser2#2562 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 55/100
fb55/htmlparser2#2468 ·
维护者通常 1 天内回复
-
Option to disable implicit HTML changes可能已有人在做 @Gravirei 于 141 天前认领。 未关闭good-first-issue
难度 5/5 一周以上 新手友好度 35/100
fb55/htmlparser2#2428 · 1 条评论 ·
维护者通常 1 天内回复
相似的 Issue
-
bug good first issue needs-review
难度 1/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
documentation public
难度 1/5 1-3 小时 新手友好度 68/100
midnightntwrk/umbradb#65 ·
维护者通常 2 天内回复
-
area/channels kind/bug priority/medium
难度 2/5 1-3 小时 新手友好度 78/100
nanocoai/nanoclaw#4501 · 1 条评论 ·
维护者通常 1 天内回复
-
needs verification
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 13 天内回复
-
微软日程推送邮箱未关闭
难度 1/5 1 小时以内 新手友好度 68/100