Commit 98ff7de

HPCesia <me@hpcesia.com>
2024-11-13 09:41:38
修复单主题时的 BUG tag: 1.2.1
1 parent 280c695
Changed files (2)
src/main.ts
@@ -69,6 +69,7 @@ export async function init(hexo: Hexo) {
     for (const extra_theme of [].concat(config.additional.themes)) {
       additional_themes.push(JSON.parse(readFileSync(extra_theme, "utf8")));
     }
+  // 处理主题
   const themes = additional_themes.concat(
     (typeof config.theme === "string" ? [config.theme] : Object.values(config.theme)).filter(
       (theme) => theme in bundledThemes
@@ -151,7 +152,7 @@ export async function init(hexo: Hexo) {
       };
     };
     try {
-      if (config.theme === "string")
+      if (typeof config.theme === "string")
         pre = highlighter.codeToHtml(code, {
           lang,
           theme: config.theme,
package.json
@@ -1,6 +1,6 @@
 {
   "name": "hexo-highlighter-shiki",
-  "version": "1.2.0",
+  "version": "1.2.1",
   "description": "A package for Hexo which use Shiki to render code highlight.",
   "main": "dist/index.js",
   "files": [