diff options
author | Martin Hanzel <mhanzel@gitlab.com> | 2019-07-16 07:09:55 +0000 |
---|---|---|
committer | Kushal Pandya <kushalspandya@gmail.com> | 2019-07-16 07:09:55 +0000 |
commit | d50f41d0f2103f78039ef4d01eda5d30ff968d6e (patch) | |
tree | ae61802eccfee6d3e2e6a619bf4b774a430428e9 /app | |
parent | 38aa79de0623cd197769adea9a22ae6762a3b638 (diff) | |
download | gitlab-ce-d50f41d0f2103f78039ef4d01eda5d30ff968d6e.tar.gz |
Fix linebreak rendering in Mermaid flowcharts
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/behaviors/markdown/render_mermaid.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/assets/javascripts/behaviors/markdown/render_mermaid.js b/app/assets/javascripts/behaviors/markdown/render_mermaid.js index b23de36f860..dbc28beffbe 100644 --- a/app/assets/javascripts/behaviors/markdown/render_mermaid.js +++ b/app/assets/javascripts/behaviors/markdown/render_mermaid.js @@ -36,7 +36,8 @@ export default function renderMermaid($els) { }); $els.each((i, el) => { - const source = el.textContent; + // Mermaid doesn't like `<br />` tags, so collapse all like tags into `<br>`, which is parsed correctly. + const source = el.textContent.replace(/<br\s*\/>/g, '<br>'); /** * Restrict the rendering to a certain amount of character to |