Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Article: the comment count above the title shows its markup, '<div class="number_of_comments">1 reactie</div>'

已关闭
#689 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

已经有一个关联 PR 被合并了。

  • #691 来自 @guidol-ive —— 已合并

评估

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

调研方向

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 内容生成。

描述

Component: User interface Impact: Medium Level: Easy Pagetype: Peer reviewed article Type: Bug Value: Visitors

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,通用步骤见我们的新手贡献指南。

从这里开始

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

PlanBCode/hypha 的其他 Issue

查看 PlanBCode/hypha 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

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