Skip to content

Commit

Permalink
wrap images in links even if the images aren't unloaded. handle resiz…
Browse files Browse the repository at this point in the history
…ed images with no file extension (as seen on wtdwtf) (#4561)
  • Loading branch information
BenLubar authored and julianlam committed Apr 27, 2016
1 parent ee2bd0c commit 37bd63a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion public/src/client/topic/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
};

Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 37bd63a

Please sign in to comment.