mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
wrap images in links even if the images aren't unloaded. handle resized images with no file extension (as seen on wtdwtf) (#4561)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user