State diagram sanitization

This commit is contained in:
Knut Sveidqvist
2021-09-29 08:45:07 +02:00
parent 5c4ee44787
commit 75b79e1b23
4 changed files with 111 additions and 6 deletions

View File

@@ -7,6 +7,7 @@ import { getConfig } from '../../config';
import { render } from '../../dagre-wrapper/index.js';
import { log } from '../../logger';
import { configureSvgSize } from '../../utils';
import common from '../common/common';
const conf = {};
export const setConf = function (cnf) {
@@ -15,6 +16,7 @@ export const setConf = function (cnf) {
conf[keys[i]] = cnf[keys[i]];
}
};
let mainConfig = getConfig();
let nodeDb = {};
@@ -51,7 +53,7 @@ const setupNode = (g, parent, node, altFlag) => {
nodeDb[node.id] = {
id: node.id,
shape,
description: node.id,
description: common.sanitizeText(node.id, getConfig()),
classes: 'statediagram-state',
};
}