File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -289,6 +289,10 @@ function playground_text(playground, hidden = true) {
289289 var themeToggleButton = document . getElementById ( 'theme-toggle' ) ;
290290 var themePopup = document . getElementById ( 'theme-list' ) ;
291291 var themeColorMetaTag = document . querySelector ( 'meta[name="theme-color"]' ) ;
292+ var themeIds = [ ] ;
293+ themePopup . querySelectorAll ( 'button.theme' ) . forEach ( function ( el ) {
294+ themeIds . push ( el . id ) ;
295+ } ) ;
292296 var stylesheets = {
293297 ayuHighlight : document . querySelector ( "[href$='ayu-highlight.css']" ) ,
294298 tomorrowNight : document . querySelector ( "[href$='tomorrow-night.css']" ) ,
@@ -317,7 +321,7 @@ function playground_text(playground, hidden = true) {
317321 function get_theme ( ) {
318322 var theme ;
319323 try { theme = localStorage . getItem ( 'mdbook-theme' ) ; } catch ( e ) { }
320- if ( theme === null || theme === undefined ) {
324+ if ( theme === null || theme === undefined || ! themeIds . includes ( theme ) ) {
321325 return default_theme ;
322326 } else {
323327 return theme ;
You can’t perform that action at this time.
0 commit comments