From 1a97302d68357f13ad06552797539268a8b37435 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 13 Aug 2014 16:25:34 -0400 Subject: [PATCH] fix double anchors around images if the image is already inside an anchor dont wrap again --- public/src/forum/topic.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 3df4a2b1c3..0300d58121 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -351,7 +351,10 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT utils.makeNumbersHumanReadable(element.find('.human-readable-number')); element.find('span.timeago').timeago(); element.find('.post-content img:not(.emoji)').addClass('img-responsive').each(function() { - $(this).wrap(''); + var $this = $(this); + if (!$this.parent().is('a')) { + $this.wrap(''); + } }); postTools.updatePostCount(); showBottomPostBar();