diff --git a/_includes/mermaid.html b/_includes/mermaid.html
index 6abef735b..2cb5cc6dd 100644
--- a/_includes/mermaid.html
+++ b/_includes/mermaid.html
@@ -16,7 +16,6 @@
theme: initTheme /* */
};
-
/* Markdown converts to HTML */
$("pre").has("code.language-mermaid").each(function() {
let svgCode = $(this).children().html();
diff --git a/_includes/mode-toggle.html b/_includes/mode-toggle.html
index 1ae94ecf8..8d49b287e 100644
--- a/_includes/mode-toggle.html
+++ b/_includes/mode-toggle.html
@@ -17,8 +17,8 @@
static get LIGHT_MODE() { return "light"; }
constructor() {
- if (this.mode != null) {
- if (this.mode == ModeToggle.DARK_MODE) {
+ if (this.hasMode) {
+ if (this.isDarkMode) {
if (!this.isSysDarkPrefer) {
this.setDark();
}
@@ -92,7 +92,7 @@
}
updateMermaid() {
- if (mermaid !== undefined) {
+ if (typeof mermaid !== "undefined") {
let expectedTheme = (this.modeStatus === ModeToggle.DARK_MODE? "dark" : "default");
let config = { theme: expectedTheme };