From 461c0dc358122e177b1d30f7d03b4abcca153d24 Mon Sep 17 00:00:00 2001 From: "Chen, Chien-ting" Date: Fri, 17 May 2019 01:10:04 +0800 Subject: [PATCH] Update gloss.js --- gloss.js | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/gloss.js b/gloss.js index 5e7996f..1930427 100644 --- a/gloss.js +++ b/gloss.js @@ -10,7 +10,7 @@ Gua2 siong1-sin3 Li2. */ -hexo.extend.filter.register('before_post_render', (data) => { +hexo.extend.filter.register('after_post_render', (data) => { var css_content = ` .css-table1{ display: table; @@ -24,23 +24,22 @@ hexo.extend.filter.register('before_post_render', (data) => { display: table-cell; padding-right: 1ex; }`; - + var css_rendered = css_content.replace(/([ ]|\t|\n)+/g, " "); - var link_js = ``; - link_css.innerHTML = "${css_rendered}"; + var link_js_rendered = link_js.replace(/(\t|\n)+/g, " ").replace(/‘/g, "'"); - document.getElementsByTagName('head')[0].appendChild(link_css); - - `; - - data.content += link_js; + data.content += link_js_rendered; return data; });