From 9974354e8f574bd507646ee6bd98f63adf65cb33 Mon Sep 17 00:00:00 2001 From: MichaelLu <277133779@qq.com> Date: Thu, 23 Nov 2017 17:40:45 +0800 Subject: [PATCH] fixed local-search xml illegal character --- scripts/plugins.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/plugins.js b/scripts/plugins.js index 6e872cc..c44224f 100644 --- a/scripts/plugins.js +++ b/scripts/plugins.js @@ -36,6 +36,9 @@ hexo.extend.filter.register('before_post_render', data => { const title = (attrs[1] && attrs[1].replace(/\"|\'/g, '')) || ''; return `{% image ${attrs[0]} '${alt}' '${title}' %}` }) - }) + }); + + //删除xml的非法字符\x08 + data.content = data.content.replace(/\x08/g, ""); return data; });