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:
Jim Yang 2019-04-18 10:46:52 +01:00 committed by GitHub
parent 7d3578b31a
commit 96516d6dd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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')