Skip to content

Conversation

@st0012
Copy link
Member

@st0012 st0012 commented Dec 14, 2025

Highlighting file paths like lib/foo/bar.rb should not be linked to the file automatically. If the writer's intention is to link it, rdoc-ref should be used.

@st0012 st0012 added the bug label Dec 14, 2025
@matzbot
Copy link
Collaborator

matzbot commented Dec 14, 2025

🚀 Preview deployment available at: https://2c9109b6.rdoc-6cd.pages.dev (commit: 3d94ce8)

@st0012 st0012 force-pushed the fix-incorrect-file-linking branch from 640c26c to 3d94ce8 Compare December 15, 2025 18:02
@st0012 st0012 requested a review from tompng December 15, 2025 18:02
text
else
# Don't auto-link file paths in backticks
return "<code>#{CGI.escapeHTML text}</code>"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the README.md content is

README `README`

Two "README" will both trigger link("README", "README", true, false).
One from handle_regexp_CROSSREFcross_referencelink
Another from convert_tt_crossrefcross_referencelink
So if we need to detect backticks, we need to pass a new argument from convert_tt_crossref.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm surprised that README without backticks would also enter here. But I guess it's the same mechanism linking String or Array automatically.
I kinda want to disable this in a breaking change release, perhaps in v8.0. WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants