fix: check options.enable and no-emoji

This commit is contained in:
crimx 2020-10-03 11:54:42 +08:00
parent c95b1331c7
commit a01582fdce

View file

@ -30,8 +30,10 @@ 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 = `<style>${getEmojiStyles()}</style>` + data.content;
if (!options.enable || data["no-emoji"]) {
if (options.inject !== false) {
data.content = `<style>${getEmojiStyles()}</style>` + data.content;
}
return data;
}