diff --git a/themes/contrast.py b/themes/contrast.py
index edaf154..9a4b56f 100644
--- a/themes/contrast.py
+++ b/themes/contrast.py
@@ -67,8 +67,14 @@ def adjust_theme():
button_cancel_text_color_dark="white",
)
- with open(os.path.join(theme_dir, "common.js"), "r", encoding="utf8") as f:
- js = f""
+ js = ""
+ for jsf in [
+ os.path.join(theme_dir, "common.js"),
+ os.path.join(theme_dir, "mermaid.min.js"),
+ os.path.join(theme_dir, "mermaid_loader.js"),
+ ]:
+ with open(jsf, "r", encoding="utf8") as f:
+ js += f""
# 添加一个萌萌的看板娘
if ADD_WAIFU:
diff --git a/themes/gradios.py b/themes/gradios.py
index 9c442e7..68f15df 100644
--- a/themes/gradios.py
+++ b/themes/gradios.py
@@ -31,8 +31,15 @@ def adjust_theme():
THEME = THEME.lstrip("huggingface-")
set_theme = set_theme.from_hub(THEME.lower())
- with open(os.path.join(theme_dir, "common.js"), "r", encoding="utf8") as f:
- js = f""
+ js = ""
+ for jsf in [
+ os.path.join(theme_dir, "common.js"),
+ os.path.join(theme_dir, "mermaid.min.js"),
+ os.path.join(theme_dir, "mermaid_loader.js"),
+ ]:
+ with open(jsf, "r", encoding="utf8") as f:
+ js += f""
+
# 添加一个萌萌的看板娘
if ADD_WAIFU:
diff --git a/themes/green.py b/themes/green.py
index 34e4ba3..8428741 100644
--- a/themes/green.py
+++ b/themes/green.py
@@ -76,8 +76,14 @@ def adjust_theme():
chatbot_code_background_color_dark="*neutral_950",
)
- with open(os.path.join(theme_dir, "common.js"), "r", encoding="utf8") as f:
- js = f""
+ js = ""
+ for jsf in [
+ os.path.join(theme_dir, "common.js"),
+ os.path.join(theme_dir, "mermaid.min.js"),
+ os.path.join(theme_dir, "mermaid_loader.js"),
+ ]:
+ with open(jsf, "r", encoding="utf8") as f:
+ js += f""
# 添加一个萌萌的看板娘
if ADD_WAIFU: