Update gloss.js

This commit is contained in:
Chen, Chien-ting 2019-05-17 01:10:04 +08:00 committed by GitHub
parent d1d4383450
commit 461c0dc358
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
});