blog-web/scripts/filter.js
结发受长生 c8baba77fe JS优化
2019-05-10 00:22:27 +08:00

9 lines
327 B
JavaScript

hexo.extend.filter.register('before_post_render', function(data){
// data.raw 是原始的文件内容
// data.content 是处理过代码块语法高亮的内容
if(hexo.config.picture_cdn) {
data.content = data.content.replace(/\]\s*\((?=(?!http).*?\))/gi,
`](${hexo.config.picture_cdn}`)
}
return data
})