diff --git a/cypress/platform/knsv.html b/cypress/platform/knsv.html index 5ed1ac576..c98ce70c8 100644 --- a/cypress/platform/knsv.html +++ b/cypress/platform/knsv.html @@ -10,10 +10,6 @@ href="https://fonts.googleapis.com/css?family=Noto+Sans+SC&display=swap" rel="stylesheet" /> -
--mindmap -[apa] - ))bapa(( +++flowchart LR + classDef aPID stroke:#4e4403,fill:#fdde29,color:#4e4403,rx:5px,ry:5px; + classDef crm stroke:#333333,fill:#DCDCDC,color:#333333,rx:5px,ry:5px; + classDef type stroke:#502604,fill:#FAB565,color:#502604,rx:20px,ry:20px;; + + O0("Joe") + class O0 aPID; + + O1("Person") + class O1 crm; + O0 -- has type -->O1["Person"] + + O2("aat:300411314") + class O2 type; + click O2 function "Sorry the newline html tags are not being processed correctly
So all of this appears on the
same line." + O0 -- has type -->O2["Bug"] + click O0 function "Lots of great info about Joe
Lots of great info about Joe
burt
fred";flowchart TD @@ -60,15 +70,21 @@ flowchart TD G --> H end end -- ++flowchart TD +id +flowchart LR a["Haiya"]===>b --flowchart TD A --> B A --> C B --> C+
+flowchart TD + A --> B + A --> C + B --> C +
flowchart TD A([stadium shape test]) @@ -83,11 +99,16 @@ flowchart TD class A someclass; class C someclass;-
+ sequenceDiagram + title: My Sequence Diagram Title + accTitle: My Acc Sequence Diagram + accDescr: My Sequence Diagram Description + + Alice->>John: Hello John, how are you? + John-->>Alice: Great! Alice-)John: See you later! -
graph TD A -->|000| B @@ -95,7 +116,7 @@ graph TD linkStyle 1 stroke:#ff3,stroke-width:4px,color:red;-
+journey accTitle: My User Journey Diagram accDescr: My User Journey Diagram Description @@ -323,12 +344,6 @@ flowchart TD htmlLabels: false, fontFamily: 'courier', }, - fontSize: 18, - curve: 'cardinal', - // securityLevel: 'sandbox', - // themeVariables: {relationLabelColor: 'red'} - // theme: 'dark', - wrap: true, }); function callback() { alert('It worked'); diff --git a/docs/Setup.md b/docs/Setup.md index bc02f194e..e359a9508 100644 --- a/docs/Setup.md +++ b/docs/Setup.md @@ -79,13 +79,13 @@ Theme , the CSS style sheet **Notes**: -- **strict**: (**default**) tags in text are encoded, click functionality is disabled -- **loose**: tags in text are allowed, click functionality is enabled -- **antiscript**: html tags in text are allowed, (only script element is removed), click - functionality is enabled -- **sandbox**: With this security level all rendering takes place in a sandboxed iframe. This - prevent any JavaScript from running in the context. This may hinder interactive functionality - of the diagram like scripts, popups in sequence diagram or links to other tabs/targets etc. +- **strict**: (**default**) tags in text are encoded, click functionality is disabled +- **loose**: tags in text are allowed, click functionality is enabled +- **antiscript**: html tags in text are allowed, (only script element is removed), click + functionality is enabled +- **sandbox**: With this security level all rendering takes place in a sandboxed iframe. This + prevent any JavaScript from running in the context. This may hinder interactive functionality + of the diagram like scripts, popups in sequence diagram or links to other tabs/targets etc. ## startOnLoad @@ -1450,7 +1450,7 @@ corresponding siteConfig value. ### Parameters -- `conf` **any** The potential currentConfig +- `conf` **any** The potential currentConfig Returns **any** The currentConfig merged with the sanitized conf @@ -1515,7 +1515,7 @@ Pushes in a directive to the configuration ### Parameters -- `directive` **[object][5]** The directive to push in +- `directive` **[object][5]** The directive to push in ## reset @@ -1545,7 +1545,7 @@ Returns **void** - `options` **MermaidConfig** -## +## ## mermaidAPI configuration defaults @@ -1610,15 +1610,9 @@ Returns **void** ``` [1]: https://github.com/mermaid-js/mermaid/blob/develop/src/mermaidAPI.js - [2]: Setup.md?id=render - [3]: 8.6.0_docs.md - [4]: #mermaidapi-configuration-defaults - [5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object - [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String - [7]: https://developer.mozilla.org/docs/Web/API/Element diff --git a/src/Diagram.ts b/src/Diagram.ts index c0fbaac07..4f1765899 100644 --- a/src/Diagram.ts +++ b/src/Diagram.ts @@ -30,7 +30,6 @@ export class Diagram { const error = { str, hash }; throw error; }; - this.db.clear(); this.parse(this.txt, parseError); } diff --git a/src/config.type.ts b/src/config.type.ts index d35f7288d..6814a265c 100644 --- a/src/config.type.ts +++ b/src/config.type.ts @@ -213,6 +213,7 @@ export interface RequirementDiagramConfig extends BaseDiagramConfig { rect_padding?: number; line_height?: number; } + export interface MindmapDiagramConfig extends BaseDiagramConfig { useMaxWidth: boolean; padding: number; diff --git a/src/diagram-api/diagram-orchestration.ts b/src/diagram-api/diagram-orchestration.ts index b0df42cd7..31119d09c 100644 --- a/src/diagram-api/diagram-orchestration.ts +++ b/src/diagram-api/diagram-orchestration.ts @@ -6,6 +6,7 @@ import mindmapParser from '../diagrams/mindmap/parser/mindmap'; import { mindmapDetector } from '../diagrams/mindmap/mindmapDetector'; import mindmapStyles from '../diagrams/mindmap/styles'; + import gitGraphDb from '../diagrams/git/gitGraphAst'; import gitGraphRenderer from '../diagrams/git/gitGraphRenderer'; // @ts-ignore diff --git a/src/diagrams/mindmap/mindamapDetector.ts b/src/diagrams/mindmap/mindamapDetector.ts new file mode 100644 index 000000000..42d6309ee --- /dev/null +++ b/src/diagrams/mindmap/mindamapDetector.ts @@ -0,0 +1,5 @@ +import { DiagramDetector } from '../../diagram-api/detectType'; + +export const mindmapDetector: DiagramDetector = (txt) => { + return txt.match(/^\s*mindmap/) !== null; +}; diff --git a/src/mermaid.ts b/src/mermaid.ts index 96b8b9c1a..48c2f8790 100644 --- a/src/mermaid.ts +++ b/src/mermaid.ts @@ -42,7 +42,6 @@ const init = function ( try { initThrowsErrors(config, nodes, callback); } catch (e) { - console.error('Syntax Error rendering'); log.warn('Syntax Error rendering'); if (isDetailedError(e)) { log.warn(e.str); @@ -128,8 +127,7 @@ const initThrowsErrors = function ( element ); } catch (error) { - console.error('Catching Error (bootstrap)', error); - log.warn('Catching Error (bootstrap)'); + log.warn('Catching Error (bootstrap)', error); // @ts-ignore // TODO: We should be throwing an error object. throw { error, message: error.str };