mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Fix issue with XML line breaks inside vertex labels
The regex needed to match the `<br>` or `<br/>` wasn't completely correct since some browsers (e.g. Chrome) attempt to turn `<br>` elements into their XHTML counter-parts: `<br/>`. This fixes the regex so both will match.
This commit is contained in:
parent
7d3578b31a
commit
96516d6dd5
@ -74,7 +74,7 @@ export const addVertices = function (vert, g) {
|
||||
} else {
|
||||
const svgLabel = document.createElementNS('http://www.w3.org/2000/svg', 'text')
|
||||
|
||||
const rows = verticeText.split(/<br>/)
|
||||
const rows = verticeText.split(/<br[\/]{0,1}>/)
|
||||
|
||||
for (let j = 0; j < rows.length; j++) {
|
||||
const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan')
|
||||
|
Loading…
x
Reference in New Issue
Block a user