mirror of
https://github.com/McShelby/hugo-theme-relearn
synced 2025-05-11 22:43:19 +08:00
mermaid: remove console warnings in IE11 #308
This commit is contained in:
parent
8f6e091a65
commit
8f59c36e10
@ -18,6 +18,10 @@
|
|||||||
{{- end }}
|
{{- end }}
|
||||||
<script>
|
<script>
|
||||||
function useMathJax( config ){
|
function useMathJax( config ){
|
||||||
|
if( !Object.assign ){
|
||||||
|
// We don't support MathJax for IE11 anyways, so bail out early
|
||||||
|
return;
|
||||||
|
}
|
||||||
window.MathJax = Object.assign( window.MathJax || {}, {
|
window.MathJax = Object.assign( window.MathJax || {}, {
|
||||||
loader: {
|
loader: {
|
||||||
load: ['[tex]/mhchem']
|
load: ['[tex]/mhchem']
|
||||||
|
@ -896,6 +896,10 @@ jQuery.fn.highlight = function(words, options) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function useMermaid( config ){
|
function useMermaid( config ){
|
||||||
|
if( !Object.assign ){
|
||||||
|
// We don't support Mermaid for IE11 anyways, so bail out early
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
if (typeof mermaid != 'undefined' && typeof mermaid.mermaidAPI != 'undefined') {
|
||||||
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
mermaid.initialize( Object.assign( { "securityLevel": "antiscript", "startOnLoad": false }, config ) );
|
||||||
if( config.theme && variants ){
|
if( config.theme && variants ){
|
||||||
@ -904,8 +908,8 @@ function useMermaid( config ){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( themeUseMermaid ){
|
if( window.themeUseMermaid ){
|
||||||
useMermaid( themeUseMermaid );
|
useMermaid( window.themeUseMermaid );
|
||||||
}
|
}
|
||||||
|
|
||||||
function useSwagger( config ){
|
function useSwagger( config ){
|
||||||
@ -914,6 +918,6 @@ function useSwagger( config ){
|
|||||||
write_style.setProperty( '--CONFIG-SWAGGER-theme', config.theme );
|
write_style.setProperty( '--CONFIG-SWAGGER-theme', config.theme );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if( themeUseSwagger ){
|
if( window.themeUseSwagger ){
|
||||||
useSwagger( themeUseSwagger );
|
useSwagger( window.themeUseSwagger );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user