mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
#1200 Unify regex for finding <br> tags throughout mermaid
This commit is contained in:
@@ -102,7 +102,7 @@ const getLabelWidth = text => {
|
||||
/* TODO: REMOVE DUPLICATION, SEE SHAPES */
|
||||
const getRows = s => {
|
||||
if (!s) return 1;
|
||||
let str = s.replace(/<br\/?>/gi, '#br#');
|
||||
let str = s.replace(/<br\s*\/?>/gi, '#br#');
|
||||
str = str.replace(/\\n/g, '#br#');
|
||||
return str.split('#br#');
|
||||
};
|
||||
|
Reference in New Issue
Block a user