You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a follow-up from #1499. Of the repro cases I provided there
URLs appear to not be linked even if the URL as a whole was added (first example), or even if they're just in comments alongside changes (second example—note that I unfolded the top of the diff to get there, not sure if that matters).
URLs do appear to be linked if they're in non-PR code blocks (third example).
The first is fixed with #2066, and the third remains fixed, but the second is still broken.
I can repro both if I visit the unfolded part directly (link) and if I go to the folded diff (link), then unfold the top (one unfold should be sufficient to see the link, at line 51).
changed the title [-]Auto-linking is not correctly applied to links in *unfolded* diffs[/-][+]Apply auto-linking after unfolding diffs[/+]on May 28, 2019
Yeah this was never supported, it would be good to support it if there's a simple event to listen to. The same goes for all other features that work on diffs/code
it would be good to support it if there's a simple event to listen to
You mean like an event for more code becoming visible on-screen? Hm… I don't know what kind of events you might be thinking of. I guess my first approach would be to detect clicks on the fold/unfold buttons and re-run any diff-processing logic after that. Probably also good to do the same after the user clicks the "this diff is too long, click to expand" button for default-collapsed files.
I thought that #2073 would fix this, but that wouldn't as on-pr-file-load was about handling events from entire file diffs being ajaxed. This issue requires us to listen on clicks in the "diff expander" links being clicked on and run linkify-code to be run again.
But that might not be enough, as linkify-code adds .rgh-linkified-code class to the entire file diff element, that might prevent us from running linkify-code on the same file diff again, which might linkify already linkified code blocks.
Activity
[-]Auto-linking is not correctly applied to links in *unfolded* diffs[/-][+]Apply auto-linking after unfolding diffs[/+]fregante commentedon May 28, 2019
Yeah this was never supported, it would be good to support it if there's a simple event to listen to. The same goes for all other features that work on diffs/code
wearhere commentedon May 28, 2019
You mean like an event for more code becoming visible on-screen? Hm… I don't know what kind of events you might be thinking of. I guess my first approach would be to detect clicks on the fold/unfold buttons and re-run any diff-processing logic after that. Probably also good to do the same after the user clicks the "this diff is too long, click to expand" button for default-collapsed files.
fregante commentedon May 29, 2019
GitHub fires their own events, like “load” and whatnot. Someone needs to find out by looking into their code (using dom breakpoints in chrome)
notlmn commentedon May 29, 2019
https://github.com/sindresorhus/refined-github/pull/2073/files#diff-ed524e4099f52cf2d11f30949a25d4e5 should fix this right!?
fregante commentedon May 29, 2019
Indeed!
fregante commentedon Aug 13, 2019
@notlmn we missed that part at some point I guess. The link in this code is not auto-linked:
example
notlmn commentedon Sep 12, 2019
I thought that #2073 would fix this, but that wouldn't as
on-pr-file-loadwas about handling events from entire file diffs being ajaxed. This issue requires us to listen on clicks in the "diff expander" links being clicked on and runlinkify-codeto be run again.But that might not be enough, as
linkify-codeadds.rgh-linkified-codeclass to the entire file diff element, that might prevent us from runninglinkify-codeon the same file diff again, which might linkify already linkified code blocks.