Skip to content

Commit

Permalink
Merge pull request #2916 from gwincr11/cg-sanitize
Browse files Browse the repository at this point in the history
feat: add sanitization consistently
  • Loading branch information
knsv authored Apr 12, 2022
2 parents 7d2e77a + 6052636 commit c13f6f7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/diagrams/er/erDb.js
Original file line number Diff line number Diff line change
@@ -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 = [];
Expand Down Expand Up @@ -69,15 +70,17 @@ 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 () {
return title;
};

const setAccDescription = function (txt) {
description = txt;
let sanitizedText = common.sanitizeText(txt, configApi.getConfig());
description = sanitizedText;
};

const getAccDescription = function () {
Expand Down
1 change: 0 additions & 1 deletion src/diagrams/pie/pieDb.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '';
Expand Down
5 changes: 4 additions & 1 deletion src/diagrams/user-journey/journeyDb.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import mermaidAPI from '../../mermaidAPI';
import * as configApi from '../../config';
import common from '../common/common';

let title = '';
let currentSection = '';
Expand All @@ -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 () {
Expand Down

0 comments on commit c13f6f7

Please sign in to comment.