diff --git a/scripts/filters/index.js b/scripts/filters/index.js index b05d95c..1c48850 100644 --- a/scripts/filters/index.js +++ b/scripts/filters/index.js @@ -5,7 +5,10 @@ hexo.extend.filter.register('after_render:html', require('./lib/img_onerror').pr function change_image(data) { if (this.theme.config.tag_plugins.image.parse_markdown) { - data.content = data.content.replace(/!\[([^\]]*)]\(([^(]+)\)/g, '{% image $2 $1 %}'); + data.content = data.content.replace( + /!\[(.*?)\]\((.*?)\s*(?:"(.*?)")?\)/g, + '{% image $2 $3 %}' + ); } return data; }