Broken html when crossref matches `#<` without linking `<`
Open
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 930
- Forks
- 465
- Avg merge
- 3d 10h
- Merged PRs (30d)
- 27
Description
https://docs.ruby-lang.org/en/4.0/Encoding/Converter.html#method-i-convpath
<p>In the above example, [#<Encoding:ISO-8859-1>,
<encoding:utf-8>] means="" a="" converter="" from="" iso-8859-1="" to="" utf-8.="" “crlf_newline”="" newline="" lf="" crlf.<="" p="">
</encoding:utf-8>]>
</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:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in lib/rdoc/markup/formatter.rb at handle_regexp_CROSSREF and compare it with RDoc::CrossReference::CROSSREF_REGEXP using the example in the issue. Verify the generated Encoding::Converter documentation no longer contains broken HTML when a cross-reference begins with a space, while the intended references still link correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ruby
- Domain
- documentation
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 58/100