mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-28 07:03:17 +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 { log } from '../../logger';
|
||||||
import mermaidAPI from '../../mermaidAPI';
|
import mermaidAPI from '../../mermaidAPI';
|
||||||
import * as configApi from '../../config';
|
import * as configApi from '../../config';
|
||||||
|
import common from '../common/common';
|
||||||
|
|
||||||
let entities = {};
|
let entities = {};
|
||||||
let relationships = [];
|
let relationships = [];
|
||||||
@ -69,7 +70,8 @@ const getRelationships = () => relationships;
|
|||||||
|
|
||||||
// Keep this - TODO: revisit...allow the diagram to have a title
|
// Keep this - TODO: revisit...allow the diagram to have a title
|
||||||
const setTitle = function (txt) {
|
const setTitle = function (txt) {
|
||||||
title = txt;
|
let sanitizedText = common.sanitizeText(txt, configApi.getConfig());
|
||||||
|
title = sanitizedText;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getTitle = function () {
|
const getTitle = function () {
|
||||||
@ -77,7 +79,8 @@ const getTitle = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const setAccDescription = function (txt) {
|
const setAccDescription = function (txt) {
|
||||||
description = txt;
|
let sanitizedText = common.sanitizeText(txt, configApi.getConfig());
|
||||||
|
description = sanitizedText;
|
||||||
};
|
};
|
||||||
|
|
||||||
const getAccDescription = function () {
|
const getAccDescription = function () {
|
||||||
|
@ -2,7 +2,6 @@ import { log } from '../../logger';
|
|||||||
import mermaidAPI from '../../mermaidAPI';
|
import mermaidAPI from '../../mermaidAPI';
|
||||||
import * as configApi from '../../config';
|
import * as configApi from '../../config';
|
||||||
import common from '../common/common';
|
import common from '../common/common';
|
||||||
const sanitizeText = (txt) => common.sanitizeText(txt, configApi.getConfig());
|
|
||||||
|
|
||||||
let sections = {};
|
let sections = {};
|
||||||
let title = '';
|
let title = '';
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import mermaidAPI from '../../mermaidAPI';
|
import mermaidAPI from '../../mermaidAPI';
|
||||||
import * as configApi from '../../config';
|
import * as configApi from '../../config';
|
||||||
|
import common from '../common/common';
|
||||||
|
|
||||||
let title = '';
|
let title = '';
|
||||||
let currentSection = '';
|
let currentSection = '';
|
||||||
@ -21,7 +22,9 @@ export const clear = function () {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const setTitle = function (txt) {
|
export const setTitle = function (txt) {
|
||||||
title = txt;
|
let sanitizedText = common.sanitizeText(txt, configApi.getConfig());
|
||||||
|
title = sanitizedText;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getTitle = function () {
|
export const getTitle = function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user