Merge pull request #118 from alexvargasbenamburg/master

fix #77 : no wrap images that already wrapped
This commit is contained in:
Mathieu Cornic 2018-01-23 18:05:25 +01:00 committed by GitHub
commit dea425fc75
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,9 @@ var images = $("div#body-inner img").not(".inline");
// Wrap image inside a featherlight (to get a full size view in a popup)
images.wrap(function(){
var image =$(this);
return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
if (!image.parent("a").length) {
return "<a href='" + image[0].src + "' data-featherlight='image'></a>";
}
});
// Change styles, depending on parameters set to the image