[fix] gallery & image
This commit is contained in:
parent
17bb9df1b1
commit
e92cb81296
|
@ -240,7 +240,6 @@ tag_plugins:
|
||||||
# {% image %}
|
# {% image %}
|
||||||
image:
|
image:
|
||||||
fancybox: false # true, false
|
fancybox: false # true, false
|
||||||
parse_markdown: true # 把 markdown 格式的图片解析成图片标签
|
|
||||||
|
|
||||||
# {% timeline %}
|
# {% timeline %}
|
||||||
timeline:
|
timeline:
|
||||||
|
|
|
@ -2,16 +2,3 @@
|
||||||
|
|
||||||
hexo.extend.filter.register('after_render:html', require('./lib/img_lazyload').processSite);
|
hexo.extend.filter.register('after_render:html', require('./lib/img_lazyload').processSite);
|
||||||
hexo.extend.filter.register('after_render:html', require('./lib/img_onerror').processSite);
|
hexo.extend.filter.register('after_render:html', require('./lib/img_onerror').processSite);
|
||||||
|
|
||||||
function change_image(data) {
|
|
||||||
if (this.theme.config.tag_plugins.image.parse_markdown) {
|
|
||||||
data.content = data.content.replace(
|
|
||||||
/!\[(.*?)\]\((.*?)\s*(?:"(.*?)")?\)/g,
|
|
||||||
'{% image $2 $3 %}'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
hexo.extend.filter.register('before_post_render', change_image, 9);
|
|
||||||
|
|
Loading…
Reference in New Issue