diff --git a/src/diagrams/er/erDb.js b/src/diagrams/er/erDb.js index 8fe54ed83..6f537f27f 100644 --- a/src/diagrams/er/erDb.js +++ b/src/diagrams/er/erDb.js @@ -1,6 +1,7 @@ import { log } from '../../logger'; import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; +import common from '../common/common'; let entities = {}; let relationships = []; @@ -69,7 +70,8 @@ const getRelationships = () => relationships; // Keep this - TODO: revisit...allow the diagram to have a title const setTitle = function (txt) { - title = txt; + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); + title = sanitizedText; }; const getTitle = function () { @@ -77,7 +79,8 @@ const getTitle = function () { }; const setAccDescription = function (txt) { - description = txt; + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); + description = sanitizedText; }; const getAccDescription = function () { diff --git a/src/diagrams/pie/pieDb.js b/src/diagrams/pie/pieDb.js index 47592b211..0ed02a4a9 100644 --- a/src/diagrams/pie/pieDb.js +++ b/src/diagrams/pie/pieDb.js @@ -2,7 +2,6 @@ import { log } from '../../logger'; import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; import common from '../common/common'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); let sections = {}; let title = ''; diff --git a/src/diagrams/user-journey/journeyDb.js b/src/diagrams/user-journey/journeyDb.js index 0452bd4a8..ff2eda876 100644 --- a/src/diagrams/user-journey/journeyDb.js +++ b/src/diagrams/user-journey/journeyDb.js @@ -1,5 +1,6 @@ import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; +import common from '../common/common'; let title = ''; let currentSection = ''; @@ -21,7 +22,9 @@ export const clear = function () { }; export const setTitle = function (txt) { - title = txt; + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); + title = sanitizedText; + }; export const getTitle = function () {