Fix detection of mermaid objects

This commit is contained in:
Cotes Chung 2020-12-11 02:20:18 +08:00
parent 63f57fbc12
commit 289ce1263d
2 changed files with 3 additions and 4 deletions

View file

@ -16,7 +16,6 @@
theme: initTheme /* <default|dark|forest|neutral> */
};
/* Markdown converts to HTML */
$("pre").has("code.language-mermaid").each(function() {
let svgCode = $(this).children().html();

View file

@ -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 };