Repository navigation
Labels
Description
Description
| Screenshot |
|
How to replicate the issue + URL
But you can see it working in this live code embed:
refined-github/test/linkify-urls-in-code.js
Lines 32 to 51 in be756e6
| test('isIssue', batchTestText, linkifyURLsInCode.hasIssue, [ | |
| '#1', | |
| '#12', | |
| 'an issue in the middle #123 of some text' // Only link to issues in comments, see #381 | |
| ], [ | |
| '#a', | |
| '1234' | |
| ]); | |
| test('findURLs', batchTestArray, linkifyURLsInCode.findURLs, [ | |
| 'http://github.com/', | |
| 'https://www.github.com', | |
| 'https://github.com/orgs/test/dashboard', | |
| 'a long string of text with a url at the end: https://github.com/dashboard?param=test' | |
| ], [ | |
| 'https://github', | |
| 'github', | |
| 'github.com', | |
| 'github/whatever/text' | |
| ]); |
Extension version
23.2.1
Browser(s) used
Safari

Activity
[-]`linkify-code` broken[/-][+]`linkify-code` broken on new file viewer[/+]amanmalh commentedon Feb 12, 2023
Hi @fregante, I need more clarification on this. I tested this on chrome, as well as safari. The URLs under 'findURLs' test seem to be working fine for me. The issue reference in the comment is working fine as well. What exactly is broken?
fregante commentedon Feb 12, 2023
Thank you for looking into this! It's related to the new code view, you'll have to enable it to see the issue: https://docs.github.com/en/search-github/github-code-search/about-github-code-search#enabling-and-disabling-the-new-code-search-and-code-view-beta
amanmalh commentedon Feb 13, 2023
StefanLobbenmeierObjego commentedon Mar 3, 2023
fregante commentedon Mar 3, 2023
kidonng commentedon Apr 6, 2023
This seems tricky because there's a
<textarea>overlay above the actual code. We can linkify the code but no one is able to click them 😅Or alternatively, we catch the click events and re-dispatch them ourselves 🤔
fregante commentedon Apr 6, 2023
🤔 what's that textarea for? Is the code inside it? How is the user able to select it?
kidonng commentedon Apr 6, 2023
Presumably for getting cursor position and acting on it, as it is easier than dealing with text nodes.
The real bummer is that the highlighted code is now pseudo-elements:
Which means in addition to dealing with clicks, we need to construct the DOM back ourselves. And a11y will suffer.
I can't think of an efficient way to do all these without breaking GitHub functionality.
fregante commentedon Apr 6, 2023
kidonng commentedon Apr 6, 2023
fregante commentedon Apr 6, 2023
6 remaining items
134130 commentedon Aug 18, 2023
🤔 We can implement in two ways.
display: absolute | relatedAnd this is my rough implement with first way.

fregante commentedon Aug 18, 2023
How does the first way work? Can you send a minimal PR? Or demo code?
Edit: I think you're suggesting the demo GIF I used earlier. The problem is that that could only highlight the entire string instead of just the URL. This would not work if a comment has a link and especially if it has more than one link.
The second suggestion would work if we add a single clickable icon somewhere nearby, but we cannot highlight the exact text or potentially even the exact line (if a comment wraps)
134130 commentedon Aug 19, 2023
Exactly.
[-]All linkifier features broken on new file viewer[/-][+]⚠️ All linkifier features broken on new file viewer[/+]SunsetTechuila commentedon Jan 16, 2026
Here is a demo of the only solution I see (go to https://github.com/refined-github/refined-github/blob/be756e68dd4bf24d53e802e1fec126506979fa80/test/linkify-urls-in-code.js and run this in the devtools console):
It is now 🎉 (almost):
https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Properties/position-anchor#browser_compatibility
[-]⚠️ All linkifier features broken on new file viewer[/-][+]`linkify-code` broken on new file viewer[/+]fregante commentedon Jul 31, 2026
Reopening because the fix was removed. Now the feature works on comments like before.
The solution is most likely still the same, except that the CSS anchors need to target a different element.
kidonng commentedon Aug 27, 2026
Not sure if this is already known, I only found out how the "wrap lines" option makes a difference just now.
Wrap lines enabled:
#read-only-cursor-text-areablocking clickslinkify-codeworksWrap lines disabled:
#read-only-cursor-text-areablocking clickslinkify-codeworks, but you can not click the links