Skip to content

Commit ded0e41

Browse files
committed
Update book.js
Update book.js Update book.js Revert "Update book.js" This reverts commit 0ed9477. Update book.js
1 parent 09b135d commit ded0e41

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/theme/book.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@ function playground_text(playground, hidden = true) {
360360
}
361361

362362
var previousTheme = get_theme();
363-
363+
var themeId = theme.replace(/\W+/g, '_').toLowerCase();
364364
if (store) {
365-
try { localStorage.setItem('mdbook-theme', theme); } catch (e) { }
365+
try { localStorage.setItem('mdbook-theme', themeId); } catch (e) { }
366366
}
367367

368368
html.classList.remove(previousTheme);
369-
html.classList.add(theme);
369+
html.classList.add(themeId);
370370
updateThemeSelected();
371371
}
372372

0 commit comments

Comments
 (0)