From 7b2c1ecb1b762068847e9ff874701399bcd042a3 Mon Sep 17 00:00:00 2001 From: Tilden Ji Date: Tue, 27 Apr 2021 15:11:41 +0800 Subject: [PATCH] fix: resolves XPoet/hexo-theme-keep#92 --- scripts/filters/lazyload-handle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/filters/lazyload-handle.js b/scripts/filters/lazyload-handle.js index 8e63e35..2e6c9c1 100644 --- a/scripts/filters/lazyload-handle.js +++ b/scripts/filters/lazyload-handle.js @@ -6,7 +6,7 @@ hexo.extend.filter.register( if (!theme.lazyload || !theme.lazyload.enable) return; data.content = data.content.replace( // Match 'img' tags width the src attribute. - /]*)src="([^"]*)"([^>]*)>/gim, + /]*)src="([^"]*)"([^>\/]*)\/?\s*>/gim, function (match, attrBegin, src, attrEnd) { // Exit if the src doesn't exists. if (!src) return match;