#702 improve handling of different "br" tag notations for multiline texts in sequence diagrams

This commit is contained in:
Marc Faber
2019-12-21 20:39:32 +01:00
parent 061d31af33
commit 233520b797
5 changed files with 63 additions and 6 deletions

View File

@@ -168,7 +168,7 @@ export const bounds = {
const _drawLongText = (text, x, y, g, width) => {
let textHeight = 0;
const lines = text.split(/<br\/?>/gi);
const lines = text.split(/<br ?\/?>/gi);
for (const line of lines) {
const textObj = svgDraw.getTextObj();
textObj.x = x;
@@ -233,7 +233,7 @@ const drawMessage = function(elem, startx, stopx, verticalPos, msg, sequenceInde
let textElem;
let counterBreaklines = 0;
let breaklineOffset = 17;
const breaklines = msg.message.split(/<br\/?>/gi);
const breaklines = msg.message.split(/<br ?\/?>/gi);
for (const breakline of breaklines) {
textElem = g
.append('text') // text label for the x axis