mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08:00
Merge pull request #2916 from gwincr11/cg-sanitize
feat: add sanitization consistently
This commit is contained in:
commit
c13f6f789f
@ -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 () {
|
||||
|
@ -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 = '';
|
||||
|
@ -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 () {
|
||||
|
Loading…
x
Reference in New Issue
Block a user