From 5452cedc517e40f46ac61e43e544800c7e71ab6a Mon Sep 17 00:00:00 2001 From: Cory Gwin Date: Fri, 8 Apr 2022 13:38:45 +0000 Subject: [PATCH] always use the same setup --- src/diagrams/er/erDb.js | 6 ++---- src/diagrams/gantt/ganttDb.js | 5 +---- src/diagrams/pie/pieDb.js | 1 - src/diagrams/user-journey/journeyDb.js | 3 +-- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/src/diagrams/er/erDb.js b/src/diagrams/er/erDb.js index 4186fd6d8..6f537f27f 100644 --- a/src/diagrams/er/erDb.js +++ b/src/diagrams/er/erDb.js @@ -8,8 +8,6 @@ let relationships = []; let title = ''; let description = ''; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); - const Cardinality = { ZERO_OR_ONE: 'ZERO_OR_ONE', ZERO_OR_MORE: 'ZERO_OR_MORE', @@ -72,7 +70,7 @@ const getRelationships = () => relationships; // Keep this - TODO: revisit...allow the diagram to have a title const setTitle = function (txt) { - let sanitizedText = sanitizeText(txt, configApi.getConfig()); + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); title = sanitizedText; }; @@ -81,7 +79,7 @@ const getTitle = function () { }; const setAccDescription = function (txt) { - let sanitizedText = sanitizeText(txt, configApi.getConfig()); + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); description = sanitizedText; }; diff --git a/src/diagrams/gantt/ganttDb.js b/src/diagrams/gantt/ganttDb.js index 01663d954..27c7d4dcb 100644 --- a/src/diagrams/gantt/ganttDb.js +++ b/src/diagrams/gantt/ganttDb.js @@ -6,9 +6,6 @@ import utils from '../../utils'; import mermaidAPI from '../../mermaidAPI'; import common from '../common/common'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); - - let dateFormat = ''; let axisFormat = ''; let todayMarker = ''; @@ -112,7 +109,7 @@ export const getLinks = function () { }; export const setTitle = function (txt) { - let sanitizedText = sanitizeText(txt, configApi.getConfig()); + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); title = sanitizedText; }; 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 6e32c0f1f..ff2eda876 100644 --- a/src/diagrams/user-journey/journeyDb.js +++ b/src/diagrams/user-journey/journeyDb.js @@ -1,7 +1,6 @@ import mermaidAPI from '../../mermaidAPI'; import * as configApi from '../../config'; import common from '../common/common'; -const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig()); let title = ''; let currentSection = ''; @@ -23,7 +22,7 @@ export const clear = function () { }; export const setTitle = function (txt) { - let sanitizedText = sanitizeText(txt, configApi.getConfig()); + let sanitizedText = common.sanitizeText(txt, configApi.getConfig()); title = sanitizedText; };