From 37bd63ab755d37ba8a74ec9d484b18f552940ab2 Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Wed, 27 Apr 2016 13:52:14 -0500 Subject: [PATCH] wrap images in links even if the images aren't unloaded. handle resized images with no file extension (as seen on wtdwtf) (#4561) --- public/src/client/topic/posts.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/public/src/client/topic/posts.js b/public/src/client/topic/posts.js index 630b91bc72..605994c9e6 100644 --- a/public/src/client/topic/posts.js +++ b/public/src/client/topic/posts.js @@ -244,6 +244,7 @@ define('forum/topic/posts', [ }).attr('data-state', 'unloaded').attr('src', 'about:blank'); } else { images.attr('data-state', 'loaded'); + Posts.wrapImagesInLinks(posts); } }; @@ -320,7 +321,7 @@ define('forum/topic/posts', [ posts.find('[component="post/content"] img:not(.emoji)').each(function() { var $this = $(this), src = $this.attr('src'), - suffixRegex = /-resized(\.[\w]+)$/; + suffixRegex = /-resized(\.[\w]+)?$/; if (utils.isRelativeUrl(src) && suffixRegex.test(src)) { src = src.replace(suffixRegex, '$1');