mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-08-23 18:26:39 +02:00
#§473 Font update for e2e tests
This commit is contained in:
@@ -27,7 +27,7 @@
|
||||
<script>
|
||||
// Notice startOnLoad=false
|
||||
// This prevents default handling in mermaid from render before the e2e logic is applied
|
||||
mermaid.initialize({
|
||||
window.mermaidDefault = {
|
||||
startOnLoad: false,
|
||||
useMaxWidth: true,
|
||||
// "themeCSS": ":root { --mermaid-font-family: \"trebuchet ms\", verdana, arial;}",
|
||||
@@ -35,7 +35,8 @@
|
||||
// fontFamily: '"Comic Sans MS", "Comic Sans", cursive'
|
||||
// fontFamily: '"Mansalva", cursive',
|
||||
fontFamily: '"Noto Sans SC", sans-serif'
|
||||
});
|
||||
};
|
||||
mermaid.initialize(window.mermaidDefault);
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -30,6 +30,11 @@ const contentLoaded = function() {
|
||||
div.innerHTML = graphObj.code;
|
||||
document.getElementsByTagName('body')[0].appendChild(div);
|
||||
}
|
||||
|
||||
if (window.mermaidDefault.fontFamily) {
|
||||
graphObj.mermaid.fontFamily = window.mermaidDefault.fontFamily;
|
||||
}
|
||||
|
||||
global.mermaid.initialize(graphObj.mermaid);
|
||||
global.mermaid.init();
|
||||
}
|
||||
|
@@ -124,7 +124,7 @@ const init = function() {
|
||||
const initialize = function(config) {
|
||||
mermaidAPI.reset();
|
||||
|
||||
// console.log('Initializing mermaid 1', config);
|
||||
// console.log('mermaid.initialize1', config);
|
||||
if (typeof config.mermaid !== 'undefined') {
|
||||
if (typeof config.mermaid.startOnLoad !== 'undefined') {
|
||||
mermaid.startOnLoad = config.mermaid.startOnLoad;
|
||||
|
Reference in New Issue
Block a user