mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-15 13:29:40 +02:00
#2560 Tetsing that the added css have balanced brackets
This commit is contained in:
@@ -60,7 +60,7 @@ import { attachFunctions } from './interactionDb';
|
||||
import { log, setLogLevel } from './logger';
|
||||
import getStyles from './styles';
|
||||
import theme from './themes';
|
||||
import utils, { directiveSanitizer, assignWithDepth } from './utils';
|
||||
import utils, { directiveSanitizer, assignWithDepth, sanitizeCss } from './utils';
|
||||
|
||||
/**
|
||||
* @param text
|
||||
@@ -223,6 +223,7 @@ const render = function (id, _txt, cb, container) {
|
||||
let txt = _txt;
|
||||
const graphInit = utils.detectInit(txt);
|
||||
if (graphInit) {
|
||||
directiveSanitizer(graphInit);
|
||||
configApi.addDirective(graphInit);
|
||||
}
|
||||
let cnf = configApi.getConfig();
|
||||
@@ -533,6 +534,9 @@ const handleDirective = function (p, directive, type) {
|
||||
p.setWrap(directive.type === 'wrap');
|
||||
}
|
||||
break;
|
||||
case 'themeCss':
|
||||
log.warn('themeCss encountered');
|
||||
break;
|
||||
default:
|
||||
log.warn(
|
||||
`Unhandled directive: source: '%%{${directive.type}: ${JSON.stringify(
|
||||
|
Reference in New Issue
Block a user