diff --git a/packages/mermaid/src/diagrams/sankey/parser/sankey.spec.ts b/packages/mermaid/src/diagrams/sankey/parser/sankey.spec.ts index 10fc869638d..6a0f0789998 100644 --- a/packages/mermaid/src/diagrams/sankey/parser/sankey.spec.ts +++ b/packages/mermaid/src/diagrams/sankey/parser/sankey.spec.ts @@ -46,5 +46,35 @@ describe('Sankey diagram', function () { `) ); }); + + it('handles special characters in node names with sankey-beta syntax', function () { + // Test for issue #7528: Sankey Diagram Parsing Failure with Special Characters + sankey.parser.parse( + prepareTextForParsing(`sankey-beta + Agricultural 'waste',Bio-conversion,124.729 + Electricity grid,Lighting & appliances,90.008 + Electricity grid,Over generation / exports,104.453 + District heating,Heating and cooling - homes,22.505 + `) + ); + const graph = sankey.parser.yy.getGraph(); + expect(graph.nodes).toHaveLength(7); + expect(graph.links).toHaveLength(4); + }); + + it('handles special characters in node names with sankey syntax', function () { + // Test for issue #7528: Sankey Diagram Parsing Failure with Special Characters + sankey.parser.parse( + prepareTextForParsing(`sankey + Agricultural 'waste',Bio-conversion,124.729 + Electricity grid,Lighting & appliances,90.008 + Electricity grid,Over generation / exports,104.453 + District heating,Heating and cooling - homes,22.505 + `) + ); + const graph = sankey.parser.yy.getGraph(); + expect(graph.nodes).toHaveLength(7); + expect(graph.links).toHaveLength(4); + }); }); }); diff --git a/packages/mermaid/src/rendering-util/rendering-elements/markers.js b/packages/mermaid/src/rendering-util/rendering-elements/markers.js index 39351654876..0f84756edb0 100644 --- a/packages/mermaid/src/rendering-util/rendering-elements/markers.js +++ b/packages/mermaid/src/rendering-util/rendering-elements/markers.js @@ -18,8 +18,8 @@ const extension = (elem, type, id) => { .attr('class', 'marker extension ' + type) .attr('refX', 18) .attr('refY', 7) - .attr('markerWidth', 190) - .attr('markerHeight', 240) + .attr('markerWidth', 20) + .attr('markerHeight', 28) .attr('orient', 'auto') .attr('markerUnits', 'userSpaceOnUse') .append('path')