-
Notifications
You must be signed in to change notification settings - Fork 447
Avoid linking file paths inside backticks #1495
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
🚀 Preview deployment available at: https://2c9109b6.rdoc-6cd.pages.dev (commit: 3d94ce8) |
640c26c to
3d94ce8
Compare
| text | ||
| else | ||
| # Don't auto-link file paths in backticks | ||
| return "<code>#{CGI.escapeHTML text}</code>" |
There was a problem hiding this comment.
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_CROSSREF → cross_reference → link
Another from convert_tt_crossref → cross_reference → link
So if we need to detect backticks, we need to pass a new argument from convert_tt_crossref.
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to disable it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.

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