mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-10-10 17:49:40 +02:00
#4967 Reverting optimimization that breaks subgraphs
This commit is contained in:
@@ -58,8 +58,10 @@
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<pre id="diagram" class="mermaid">
|
<pre id="diagram" class="mermaid">
|
||||||
classDiagram
|
flowchart-elk LR
|
||||||
`Class<img src=x onerror=alert(1)>` <|-- `Class2<img src=x onerror=alert(2)>`
|
subgraph example
|
||||||
|
node
|
||||||
|
end
|
||||||
</pre>
|
</pre>
|
||||||
<pre id="diagram" class="mermaid2">
|
<pre id="diagram" class="mermaid2">
|
||||||
flowchart
|
flowchart
|
||||||
|
@@ -803,8 +803,14 @@ const insertChildren = (nodeArray, parentLookupDb) => {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
export const draw = async function (text, id, _version, diagObj) {
|
export const draw = async function (text, id, _version, diagObj) {
|
||||||
|
// Add temporary render element
|
||||||
|
diagObj.db.clear();
|
||||||
nodeDb = {};
|
nodeDb = {};
|
||||||
portPos = {};
|
portPos = {};
|
||||||
|
diagObj.db.setGen('gen-2');
|
||||||
|
// Parse the graph definition
|
||||||
|
diagObj.parser.parse(text);
|
||||||
|
|
||||||
const renderEl = select('body').append('div').attr('style', 'height:400px').attr('id', 'cy');
|
const renderEl = select('body').append('div').attr('style', 'height:400px').attr('id', 'cy');
|
||||||
let graph = {
|
let graph = {
|
||||||
id: 'root',
|
id: 'root',
|
||||||
|
Reference in New Issue
Block a user