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