pie title Pets adopted by volunteers
"Dogs" : 386
"Cats" : 85
@@ -63,7 +64,7 @@ commit
commit
merge newbranch
+
sequenceDiagram
participant a as Alice
participant j as John
@@ -75,8 +76,7 @@ sequenceDiagram
links a: {"Dashboard": "https://www.contoso.com/dashboard", "On-Call": "https://www.contoso.com/oncall"}
link a: Contacts @ https://contacts.contoso.com/?contact=alice@contoso.com
a->>j: Hello John, how are you?
- j-->>a: Great!
-
+ j-->>a: Great!
journey
title My working day
@@ -144,21 +144,13 @@ requirementDiagram
a1-->a2-->a3
end
- flowchart TB
- Function-->URL
+
+ flowchart LR
+ Function-->URL-->A-->B-->C
click Function clickByFlow "Add a div"
click URL "https://mermaid-js.github.io/mermaid/#/" "Visit mermaid docs" _blank
- classDiagram-v2
- class Test
- class ShapeLink
- link ShapeLink "https://mermaid-js.github.io/mermaid/#/" "This is a tooltip for a link"
- class ShapeCallback
- callback ShapeCallback "clickByClass" "This is a tooltip for a callback"
-
-
gantt
dateFormat YYYY-MM-DD
axisFormat %d/%m
@@ -264,7 +256,12 @@ class Class10 {
htmlLabels: true,
},
// gantt: { axisFormat: '%m/%d/%Y' },
- sequence: { actorFontFamily: 'courier', actorMargin: 50, showSequenceNumbers: false },
+ sequence: {
+ actorFontFamily: 'courier',
+ actorMargin: 50,
+ showSequenceNumbers: false,
+ // forceMenus: true,
+ },
// sequenceDiagram: { actorMargin: 300, forceMenus: false }, // deprecated
// fontFamily: '"times", sans-serif',
// fontFamily: 'courier',
@@ -276,7 +273,7 @@ class Class10 {
logLevel: 0,
fontSize: 18,
curve: 'cardinal',
- securityLevel: 'sandbox',
+ // securityLevel: 'sandbox',
// themeVariables: {relationLabelColor: 'red'}
});
function callback() {
diff --git a/src/dagre-wrapper/nodes.js b/src/dagre-wrapper/nodes.js
index 3123ce3bb..cb25f7fc0 100644
--- a/src/dagre-wrapper/nodes.js
+++ b/src/dagre-wrapper/nodes.js
@@ -6,7 +6,9 @@ import intersect from './intersect/index.js';
import createLabel from './createLabel';
import note from './shapes/note';
import { parseMember } from '../diagrams/class/svgDraw';
-import { evaluate } from '../diagrams/common/common';
+import { evaluate, sanitizeText as sanitize } from '../diagrams/common/common';
+
+const sanitizeText = (txt) => sanitize(txt, getConfig());
const question = (parent, node) => {
const { shapeSvg, bbox } = labelHelper(parent, node, undefined, true);
diff --git a/src/diagrams/class/classDb.js b/src/diagrams/class/classDb.js
index f2fc015e3..abfb58a17 100644
--- a/src/diagrams/class/classDb.js
+++ b/src/diagrams/class/classDb.js
@@ -216,7 +216,7 @@ export const setLink = function (ids, linkStr, target) {
if (config.securityLevel === 'sandbox') {
classes[id].linkTarget = '_top';
} else if (typeof target === 'string') {
- classes[id].linkTarget = target;
+ classes[id].linkTarget = sanitizeText(target);
} else {
classes[id].linkTarget = '_blank';
}
diff --git a/src/mermaidAPI.js b/src/mermaidAPI.js
index c87075a59..e7285d7c3 100755
--- a/src/mermaidAPI.js
+++ b/src/mermaidAPI.js
@@ -528,7 +528,7 @@ const render = function (id, _txt, cb, container) {
let width = '100%';
let height = '100%';
if (svgEl) {
- width = svgEl.viewBox.baseVal.width + 'px';
+ // width = svgEl.viewBox.baseVal.width + 'px';
height = svgEl.viewBox.baseVal.height + 'px';
}
svgCode = `