#903 Fix for broken build

This commit is contained in:
Knut Sveidqvist
2019-12-07 15:06:44 +01:00
parent c2e5e94b37
commit ab191abd5a
3 changed files with 23 additions and 19 deletions

View File

@@ -22,7 +22,13 @@ let funs = [];
const sanitize = text => {
let txt = text;
if (config.securityLevel !== 'loose' && config.flowchart.htmlLabels) { // eslint-disable-line
let htmlLabels = true;
if (
config.flowchart &&
(config.flowchart.htmlLabels === false || config.flowchart.htmlLabels === 'false')
)
htmlLabels = false;
if (config.securityLevel !== 'loose' && htmlLabels) { // eslint-disable-line
txt = txt.replace(/<br>/g, '#br#');
txt = txt.replace(/<br\S*?\/>/g, '#br#');
txt = txt.replace(/</g, '&lt;').replace(/>/g, '&gt;');