mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55: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');
|
}).attr('data-state', 'unloaded').attr('src', 'about:blank');
|
||||||
} else {
|
} else {
|
||||||
images.attr('data-state', 'loaded');
|
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() {
|
posts.find('[component="post/content"] img:not(.emoji)').each(function() {
|
||||||
var $this = $(this),
|
var $this = $(this),
|
||||||
src = $this.attr('src'),
|
src = $this.attr('src'),
|
||||||
suffixRegex = /-resized(\.[\w]+)$/;
|
suffixRegex = /-resized(\.[\w]+)?$/;
|
||||||
|
|
||||||
if (utils.isRelativeUrl(src) && suffixRegex.test(src)) {
|
if (utils.isRelativeUrl(src) && suffixRegex.test(src)) {
|
||||||
src = src.replace(suffixRegex, '$1');
|
src = src.replace(suffixRegex, '$1');
|
||||||
|
|||||||
Reference in New Issue
Block a user