From 7f7f78cd6e535950db1d8056184a8085897e6185 Mon Sep 17 00:00:00 2001 From: crimx Date: Sat, 3 Oct 2020 11:41:24 +0800 Subject: [PATCH] fix: fix #28 --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 247abba..15258b0 100644 --- a/index.js +++ b/index.js @@ -32,7 +32,7 @@ hexo.extend.tag.register("github_emoji", (args) => hexo.extend.filter.register("after_post_render", (data) => { if (options.inject !== false && (!options.enable || data["no-emoji"])) { data.content = `` + data.content; - return data + return data; } const $content = new JSDOM(data.content); @@ -63,7 +63,7 @@ function replaceColons(node, emojis) { for (let i = node.childNodes.length - 1; i >= 0; i--) { const child = node.childNodes[i]; if (child.tagName === "PRE" || child.tagName === "CODE") { - return; + continue; } if (child.nodeType === 3) { const content = child.data.replace(/:(\w+):/gi, (match, p1) => @@ -182,5 +182,5 @@ function getEmojiStyles() { opacity: 0 !important; }`; - return rules.replace(/^ +/gm, ' ').replace(/\n/g, '') + return rules.replace(/^ +/gm, " ").replace(/\n/g, ""); }