mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-12 20:09:46 +02:00
fix: ensure edge labels respect htmlLabels=false
on-behalf-of: @Mermaid-Chart <hello@mermaidchart.com>
This commit is contained in:
@@ -122,6 +122,46 @@ describe('Flowchart v2', () => {
|
||||
expect(svg).to.not.have.attr('style');
|
||||
});
|
||||
});
|
||||
it('renders only pure SVG labels (no <foreignObject>) when flowchart.htmlLabels=false', () => {
|
||||
renderGraph(
|
||||
`---
|
||||
config:
|
||||
flowchart:
|
||||
htmlLabels: false
|
||||
---
|
||||
flowchart LR
|
||||
subgraph \`**One**\`
|
||||
a["\`**The cat**
|
||||
in the hat\`"] -- "\`**edge label**\`" --> b{{"\`**The dog** in the hog\`"}}
|
||||
end
|
||||
subgraph \`**Two**\`
|
||||
c["\`**The cat**
|
||||
in the hat\`"] -- "\`**Bold edge label**\`" --> d["\`The dog in the hog\`"]
|
||||
end
|
||||
`
|
||||
);
|
||||
cy.get('svg').find('foreignObject').should('not.exist');
|
||||
});
|
||||
|
||||
it('renders only pure SVG labels (no <foreignObject>) when global htmlLabels=false', () => {
|
||||
renderGraph(
|
||||
`---
|
||||
config:
|
||||
htmlLabels: false
|
||||
---
|
||||
flowchart LR
|
||||
subgraph \`**One**\`
|
||||
a["\`**The cat**
|
||||
in the hat\`"] -- "\`**edge label**\`" --> b{{"\`**The dog** in the hog\`"}}
|
||||
end
|
||||
subgraph \`**Two**\`
|
||||
c["\`**The cat**
|
||||
in the hat\`"] -- "\`**Bold edge label**\`" --> d["\`The dog in the hog\`"]
|
||||
end
|
||||
`
|
||||
);
|
||||
cy.get('svg').find('foreignObject').should('not.exist');
|
||||
});
|
||||
|
||||
it('V2 - 16: Render Stadium shape', () => {
|
||||
imgSnapshotTest(
|
||||
|
Reference in New Issue
Block a user