mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-22 00:40:22 +02:00
Extend the br
tag regex
This extends the `br` tag regex to accommodate an arbitrary amount of any type of whitespace instead of a single space character, which holds more closely to the HTML spec[1] This extends the fix to #702 added in #1153 [1]: http://www.w3.org/TR/REC-xml/#sec-starttags
This commit is contained in:
@@ -246,7 +246,7 @@ export const addEdges = function(edges, g) {
|
||||
edgeData.label = '<span class="edgeLabel">' + edge.text + '</span>';
|
||||
} else {
|
||||
edgeData.labelType = 'text';
|
||||
edgeData.label = edge.text.replace(/<br ?\/?>/g, '\n');
|
||||
edgeData.label = edge.text.replace(/<br\s*\/?>/g, '\n');
|
||||
|
||||
if (typeof edge.style === 'undefined') {
|
||||
edgeData.style = edgeData.style || 'stroke: #333; stroke-width: 1.5px;fill:none';
|
||||
|
Reference in New Issue
Block a user