Update gloss.js
This commit is contained in:
parent
d1d4383450
commit
461c0dc358
1 changed files with 12 additions and 13 deletions
19
gloss.js
19
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;
|
||||
|
@ -27,20 +27,19 @@ hexo.extend.filter.register('before_post_render', (data) => {
|
|||
|
||||
var css_rendered = css_content.replace(/([ ]|\t|\n)+/g, " ");
|
||||
|
||||
var link_js = `<script type=\"text/javascript">
|
||||
alert("123");
|
||||
head = document.getElementsByTagName('head');
|
||||
|
||||
link_css = document.createElement('style');
|
||||
link_css.setAttribute('type', 'text/css');
|
||||
var link_js = `<script type="text/javascript">
|
||||
var head = document.getElementsByTagName(\"head\");
|
||||
var link_css = document.createElement('style');
|
||||
|
||||
link_css.innerHTML = "${css_rendered}";
|
||||
link_css.setAttribute('type', 'text/css');
|
||||
link_css.innerHTML = '${css_rendered}';
|
||||
|
||||
document.getElementsByTagName('head')[0].appendChild(link_css);
|
||||
document.getElementsByTagName('head')[0].appendChild(link_css);</script>`;
|
||||
|
||||
</script>`;
|
||||
var link_js_rendered = link_js.replace(/(\t|\n)+/g, " ").replace(/‘/g, "'");
|
||||
|
||||
data.content += link_js;
|
||||
data.content += link_js_rendered;
|
||||
return data;
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue