fix: remove right padding when a label contains HTML entities

Decode the HTML entities from the label text before adding them to the
HTML this prevents a miss-calculation of the label text length
This commit is contained in:
Lorens León
2022-07-12 17:55:43 +02:00
parent 1ed926b491
commit c40368b0fa
2 changed files with 14 additions and 1 deletions

View File

@@ -509,4 +509,16 @@ stateDiagram-v2
expect(svg).to.not.have.attr('style');
});
});
it('v2 should render a state diagram and set the correct length of the labels', () => {
imgSnapshotTest(
`
stateDiagram-v2
[*] --> 1
1 --> 2: test({ foo#colon; 'far' })
2 --> [*]
`,
{ logLevel: 0, fontFamily: 'courier' }
);
});
});