mirror of
https://github.com/McShelby/hugo-theme-relearn.git
synced 2024-11-23 15:57:57 +00:00
parent
a718c05324
commit
b2b527756b
1 changed files with 9 additions and 15 deletions
|
@ -196,20 +196,14 @@ function initMermaid( update, attrs ) {
|
||||||
document.querySelectorAll('.mermaid').forEach( function( element ){
|
document.querySelectorAll('.mermaid').forEach( function( element ){
|
||||||
var parse = parseGraph( decodeHTML( element.innerHTML ) );
|
var parse = parseGraph( decodeHTML( element.innerHTML ) );
|
||||||
|
|
||||||
if( JSON.stringify(parse.dir) === '{}' ){
|
if( parse.yaml.theme ){
|
||||||
if( parse.yaml.theme ){
|
parse.yaml.relearn_user_theme = true;
|
||||||
parse.yaml.relearn_user_theme = true;
|
}
|
||||||
}
|
if( parse.dir.theme ){
|
||||||
if( !parse.yaml.relearn_user_theme ){
|
parse.dir.relearn_user_theme = true;
|
||||||
parse.yaml.theme = theme;
|
}
|
||||||
}
|
if( !parse.yaml.relearn_user_theme && !parse.dir.relearn_user_theme ){
|
||||||
} else {
|
parse.yaml.theme = theme;
|
||||||
if( parse.dir.theme ){
|
|
||||||
parse.dir.relearn_user_theme = true;
|
|
||||||
}
|
|
||||||
if( !parse.dir.relearn_user_theme ){
|
|
||||||
parse.dir.theme = theme;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
is_initialized = true;
|
is_initialized = true;
|
||||||
|
|
||||||
|
@ -239,7 +233,7 @@ function initMermaid( update, attrs ) {
|
||||||
}
|
}
|
||||||
is_initialized = true;
|
is_initialized = true;
|
||||||
|
|
||||||
parse.dir.theme = theme;
|
parse.yaml.theme = theme;
|
||||||
var graph = serializeGraph( parse );
|
var graph = serializeGraph( parse );
|
||||||
element.removeAttribute('data-processed');
|
element.removeAttribute('data-processed');
|
||||||
element.innerHTML = graph;
|
element.innerHTML = graph;
|
||||||
|
|
Loading…
Reference in a new issue