mirror of
				https://github.com/mermaid-js/mermaid.git
				synced 2025-10-25 00:44:10 +02:00 
			
		
		
		
	 335ba40dd0
			
		
	
	335ba40dd0
	
	
	
		
			
			Sometimes, Cypress takes the screenshot for marker_unique_id.html early,
before mermaid has finished rendering the diagrams.
Fixes: 924c9e913b
Co-authored-by: Sidharth Vinod <sidharthv96@gmail.com>
		
	
		
			
				
	
	
		
			54 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			54 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <html>
 | |
|   <head> </head>
 | |
|   <body>
 | |
|     <h1>Example</h1>
 | |
|     <pre class="mermaid">
 | |
|       %%{init:{"theme":"base", "themeVariables": {"lineColor":"red"}}}%%
 | |
|       flowchart LR
 | |
|       subgraph red
 | |
|       A --> B
 | |
|       end
 | |
|     </pre>
 | |
|     <pre class="mermaid">
 | |
|       %%{init:{"theme":"base", "themeVariables": {"lineColor":"blue"}}}%%
 | |
|       flowchart LR
 | |
|       subgraph black
 | |
|       A --> B
 | |
|       end
 | |
|     </pre>
 | |
|     <pre class="mermaid">
 | |
|       ---
 | |
|       config:
 | |
|         theme: base
 | |
|         themeVariables:
 | |
|           lineColor: yellow
 | |
|       ---
 | |
|       flowchart LR
 | |
|       subgraph red
 | |
|       A --> B
 | |
|       end
 | |
|     </pre>
 | |
|     <pre class="mermaid">
 | |
|       ---
 | |
|       config:
 | |
|         theme: base
 | |
|         themeVariables:
 | |
|           lineColor: green
 | |
|       ---
 | |
|       flowchart LR
 | |
|       subgraph black
 | |
|       A --> B
 | |
|       end
 | |
|     </pre>
 | |
|     <script type="module">
 | |
|       import mermaid from './mermaid.esm.mjs';
 | |
|       mermaid.initialize({ startOnLoad: false, logLevel: 0 });
 | |
|       await mermaid.run();
 | |
| 
 | |
|       if (window.Cypress) {
 | |
|         window.rendered = true;
 | |
|       }
 | |
|     </script>
 | |
|   </body>
 | |
| </html>
 |