[Enhancement] enhance html spacing - #6617
Conversation
属于是没写完Glavo就合了 (bushi |
其实是合并完我才发现有地方不对劲((( |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4c0c8f8510
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Glavo
left a comment
There was a problem hiding this comment.
本审查建议由 GPT-5.6 Sol 生成
已将具体审查建议标注在对应代码行。
| if (child instanceof AutoLineBreak || child instanceof Text txt && isSpacing(txt.getText())) { | ||
| // NO-OP | ||
| } else { | ||
| this.children.subList(i + 1, size).clear(); |
There was a problem hiding this comment.
[P2] 应清理最后一个文本节点内部的尾随空白
对于 <p>x </p> 这样的内容,Jsoup 会生成 Text("x "),后面再跟一个 AutoLineBreak。由于 isSpacing("x ") 返回 false,当前循环只会删除换行节点,却保留 x 后面的空格。这样不仅未彻底清理尾随空白,还可能影响 TextFlow 的尺寸计算和自动换行。
There was a problem hiding this comment.
我认为这不应该处理。照这么说,一个 Text 节点内如果包含了一堆连起来的换行符岂不是也得找出来?既然空格是节点的一部分就不应该处理
自己欠的债自己还(