sindresorhus/refined-github

Apply auto-linking after unfolding diffs #2091

wearhere posted onGitHub

This is a follow-up from https://github.com/sindresorhus/refined-github/issues/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 https://github.com/sindresorhus/refined-github/pull/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).

Not sure if this is a regression or no.


@notlmn we missed that part at some point I guess. The link in this code is not auto-linked:

example

posted by fregante over 5 years ago

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.

posted by notlmn over 5 years ago

Fund this Issue

$0.00
Funded

Pull requests