Skip to content

Commit

Permalink
Merge 4ad354a into 4805394
Browse files Browse the repository at this point in the history
  • Loading branch information
knsv committed Jan 26, 2020
2 parents 4805394 + 4ad354a commit 37d4d6a
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 1 deletion.
39 changes: 39 additions & 0 deletions cypress/platform/huge.html

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions src/diagrams/flowchart/parser/flow-huge.spec.js

Large diffs are not rendered by default.

10 changes: 9 additions & 1 deletion src/mermaidAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ const config = {
*/
theme: 'default',
themeCSS: undefined,
/* **maxTextSize** - The maximum allowed size of the users text diamgram */
maxTextSize: 50000,

/**
* **fontFamily** The font to be used for the rendered diagrams. Default value is \"trebuchet ms\", verdana, arial;
Expand Down Expand Up @@ -460,7 +462,13 @@ export const decodeEntities = function(text) {
* provided a hidden div will be inserted in the body of the page instead. The element will be removed when rendering is
* completed.
*/
const render = function(id, txt, cb, container) {
const render = function(id, _txt, cb, container) {
// Check the maximum allowed text size
let txt = _txt;
if (_txt.length > config.maxTextSize) {
txt = 'graph TB;a[Maximum text size in diagram exceeded];style a fill:#faa';
}

if (typeof container !== 'undefined') {
container.innerHTML = '';

Expand Down

0 comments on commit 37d4d6a

Please sign in to comment.