mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 07:19:41 +02:00
#903 Allowing >,< and = characters in svg. Updating xss tests to handle both htmlLabels and non htmlLabels
This commit is contained in:
@@ -22,7 +22,7 @@ let funs = [];
|
||||
|
||||
const sanitize = text => {
|
||||
let txt = text;
|
||||
if (config.securityLevel !== 'loose') {
|
||||
if (config.securityLevel !== 'loose' && config.flowchart.htmlLabels) { // eslint-disable-line
|
||||
txt = txt.replace(/<br>/g, '#br#');
|
||||
txt = txt.replace(/<br\S*?\/>/g, '#br#');
|
||||
txt = txt.replace(/</g, '<').replace(/>/g, '>');
|
||||
|
@@ -30,6 +30,7 @@ import { logger } from './logger';
|
||||
*/
|
||||
const init = function() {
|
||||
const conf = mermaidAPI.getConfig();
|
||||
console.warn('mermaid conf', conf);
|
||||
logger.debug('Starting rendering diagrams');
|
||||
let nodes;
|
||||
if (arguments.length >= 2) {
|
||||
@@ -116,6 +117,7 @@ const init = function() {
|
||||
};
|
||||
|
||||
const initialize = function(config) {
|
||||
console.warn('Initializing mermaid ', config);
|
||||
logger.debug('Initializing mermaid ');
|
||||
if (typeof config.mermaid !== 'undefined') {
|
||||
if (typeof config.mermaid.startOnLoad !== 'undefined') {
|
||||
|
Reference in New Issue
Block a user