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

Broken html when crossref matches `#<` without linking `<`

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

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
58/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
ruby
领域
documentation

调研方向

从 lib/rdoc/markup/formatter.rb 中的 handle_regexp_CROSSREF 开始,使用 issue 中的示例将其与 RDoc::CrossReference::CROSSREF_REGEXP 进行比较。验证生成的 Encoding::Converter 文档在交叉引用以空格开头时不再包含损坏的 HTML,同时预期的引用仍能正确链接。

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

描述

https://docs.ruby-lang.org/en/4.0/Encoding/Converter.html#method-i-convpath

<p>In the above example, [#&lt;Encoding:ISO-8859-1&gt;,
 <encoding:utf-8&gt;] means="" a="" converter="" from="" iso-8859-1="" to="" utf-8.="" “crlf_newline”="" newline="" lf="" crlf.<="" p="">
 </encoding:utf-8&gt;]>
</p>

Second #<Encoding with a leading space is matched:

"In the above example, [#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>] means"
  .match(RDoc::CrossReference::CROSSREF_REGEXP, 2)

# => #<MatchData " #<" 1:"#<" 2:nil 3:nil 4:nil 5:"<" 6:nil>

"<" doesn't get linked by handle_regexp_CROSSREF and assigns handled as unescaped text "<" which breaks html:

https://github.com/ruby/rdoc/blob/d6422f499fb2961b91de400f48426fc6d3fa5b67/lib/rdoc/markup/formatter.rb#L113-L115

主要语言
Ruby
星标
927
派生
467
平均合并
23 小时 47 分钟
30 天内合并 PR
12

环境准备

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

从这里开始

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

ruby/rdoc 的其他 Issue

查看 ruby/rdoc 的全部 Issue

相似的 Issue

更多 Ruby Issue

把新 issue 发到你的邮箱

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