diff options
author | Alex Vargas Benamburg <vb.alexr@gmail.com> | 2018-01-23 08:33:14 +0300 |
---|---|---|
committer | Alex Vargas Benamburg <vb.alexr@gmail.com> | 2018-01-23 08:33:14 +0300 |
commit | d67055469de0093472d897276def47e6d97bac2a (patch) | |
tree | 3e23cc5cef861274770f7beba68969f2e952a888 /static | |
parent | 7df323095725662af37b178afd0b9f104ef7d742 (diff) |
fix: no wrap images that already wrapped
Diffstat (limited to 'static')
-rw-r--r-- | static/js/hugo-learn.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/static/js/hugo-learn.js b/static/js/hugo-learn.js index b20313a..213e31e 100644 --- a/static/js/hugo-learn.js +++ b/static/js/hugo-learn.js @@ -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 |