diff --git a/scripts/filters/post.js b/scripts/filters/post.js index 511de93..23f3aab 100644 --- a/scripts/filters/post.js +++ b/scripts/filters/post.js @@ -10,13 +10,13 @@ hexo.extend.filter.register('after_post_render', data => { const theme = hexo.theme.config; if (!theme.exturl && !theme.lazyload) return; if (theme.lazyload) { - data.content = data.content.replace(/(]*) src=/img, '$1 data-src='); + data.content = data.content.replace(/(]*)src=/ig, '$1data-src='); } if (theme.exturl) { const siteHost = parse(config.url).hostname || config.url; // External URL icon const exturlIcon = theme.exturl_icon ? '' : ''; - data.content = data.content.replace(/]* href="([^"]+)"[^>]*>([^<]+)<\/a>/img, (match, href, html) => { + data.content = data.content.replace(/]*href="([^"]+)"[^>]*>([^<]+)<\/a>/ig, (match, href, html) => { // Exit if the href attribute doesn't exists. if (!href) return match;