Merge pull request #2916 from gwincr11/cg-sanitize

feat: add sanitization consistently
This commit is contained in:
Knut Sveidqvist 2022-04-12 07:20:39 +02:00 committed by GitHub
commit c13f6f789f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 4 deletions

View File

@ -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 () {

View File

@ -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 = '';

View File

@ -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 () {