Skip to content

Commit

Permalink
Fix: GitHub not loading private user images (#1454)
Browse files Browse the repository at this point in the history
* Fix: Github not loading private-user-images

* Update github.js

* Update variable scopes
  • Loading branch information
LiliaDoe authored Nov 6, 2024
1 parent 7ae5e25 commit 679d12d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/github.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,20 @@ hoverZoomPlugins.push({
name:'GitHub',
version:'0.3',
prepareImgLinks:function (callback) {
var res = [];
const res = [];

$('a > img[data-canonical-src]').each(function () {
var img = $(this);
let img = $(this);
img.data('hoverZoomSrc', [img.attr('data-canonical-src')]);
img.data('hoverZoomCaption', [img.attr('alt')]);
res.push(img);
});

$('img[src*="private-user-images"]').each(function () {
let img = $(this);
img.data('hoverZoomSrc', [img.attr('src')]);
res.push(img);
});

hoverZoom.urlReplace(res,
'a[href*="/blob/"]',
Expand Down

0 comments on commit 679d12d

Please sign in to comment.