Article: the comment count above the title shows its markup, '<div class="number_of_comments">1 reactie</div>'
维护者通常 1 天内回复
已经有一个关联 PR 被合并了。
- #691 来自 @guidol-ive —— 已合并
评估
调研方向
Start in peer_reviewed_article::defaultView() at the before() call that inserts the comment count above pagename; the issue names this as the only call of its kind. Read how the surrounding code creates and updates DOM elements, then reproduce with tests/site/maak-site.php and one public comment. Done means the count displays as text inside an element with the number_of_comments class, without showing markup.
由索引模型根据 Issue 内容生成。
描述
An article with public comments shows the count as text, markup included, above its title:
<div class="number_of_comments">1 reactie</div>
peer_reviewed_article::defaultView() passes an HTML string to before():
$this->html->getElementById('pagename')->before('<div class="number_of_comments">'.$commentCountText.'</div>');
With php-dom-wrapper, before() parsed the string as HTML. Since main uses Hypha's own DOM helpers (5dae13a), this is PHP's DOMChildNode::before(), which inserts a string as a text node. It is the only call of this kind in the code.
Seen on a test copy of a site with fictional and real articles; reproduced on a fictional site (tests/site/maak-site.php) with one public comment, PHP 8.2 and 8.5.
Fix: build the element with createElement, setAttribute('class', …) and setText.
🤖 Generated with Claude Code
- 主要语言
- JavaScript
- 星标
- 5
- 派生
- 9
- 平均合并
- 19 小时 10 分钟
- 30 天内合并 PR
- 12
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
PlanBCode/hypha 的其他 Issue
-
Component: User interface Impact: Low Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors
难度 2/5 1-3 小时 新手友好度 75/100
维护者通常 1 天内回复
-
Impact: Medium Level: Easy Type: Bug Value: Users
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
Impact: Low Level: Easy Pagetype: Festival Type: Bug Value: Coders
难度 1/5 1 小时以内 新手友好度 82/100
维护者通常 1 天内回复
-
Impact: Medium Level: Easy Pagetype: Mailinglist Type: Bug Value: Users
难度 2/5 1-3 小时 新手友好度 79/100
维护者通常 1 天内回复
-
Impact: Low Level: Easy Type: Bug Value: Coders
难度 1/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
相似的 Issue
-
难度 1/5 1 小时以内 新手友好度 92/100
danilogiles/enki-browser#113 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
维护者通常 1 天内回复
-
ux
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
bug triage
难度 2/5 1-3 小时 新手友好度 74/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 95/100
weavefox/awesome-opc#29 ·
维护者通常 1 天内回复