mermaid: header is showing up in FF

This commit is contained in:
Sören Weber 2022-07-17 19:42:07 +02:00
parent 4a50b27d65
commit 8f6e091a65
No known key found for this signature in database
GPG key ID: 07D17FF580AE7589
2 changed files with 26 additions and 18 deletions
static/js

View file

@ -894,3 +894,26 @@ jQuery.fn.highlight = function(words, options) {
jQuery.highlight(this, re, settings.element, settings.className);
});
};
function useMermaid( config ){
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
if( config.theme && variants ){
var write_style = variants.findLoadedStylesheet( 'variant-style' );
write_style.setProperty( '--CONFIG-MERMAID-theme', config.theme );
}
}
}
if( themeUseMermaid ){
useMermaid( themeUseMermaid );
}
function useSwagger( config ){
if( config.theme && variants ){
var write_style = variants.findLoadedStylesheet( 'variant-style' );
write_style.setProperty( '--CONFIG-SWAGGER-theme', config.theme );
}
}
if( themeUseSwagger ){
useSwagger( themeUseSwagger );
}