Merge pull request #1557 from cmmoran/develop

Render tweak - each diagram should reset the config to siteConfig upon rendering
This commit is contained in:
Knut Sveidqvist
2020-07-20 11:01:29 +02:00
committed by GitHub
2 changed files with 16 additions and 8 deletions

View File

@@ -197,16 +197,20 @@ export const decodeEntities = function(text) {
* completed.
*/
const render = function(id, _txt, cb, container) {
const cnf = getConfig();
// Check the maximum allowed text size
let txt = _txt;
if (_txt.length > cnf.maxTextSize) {
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
}
const graphInit = utils.detectInit(txt);
if (graphInit) {
reinitialize(graphInit);
assignWithDepth(cnf, getConfig());
} else {
configApi.reset();
const siteConfig = getSiteConfig();
updateRendererConfigs(siteConfig);
}
const cnf = getConfig();
// Check the maximum allowed text size
if (_txt.length > cnf.maxTextSize) {
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
}
if (typeof container !== 'undefined') {