diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 9b9c75b92..311b03c8e 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -12,6 +12,8 @@ categories: change-template: '- $TITLE (#$NUMBER) @$AUTHOR' branches: - develop +exclude-labels: + - 'Skip changelog' no-changes-template: 'This release contains minor changes and bugfixes.' template: | # Release Notes diff --git a/cypress/integration/other/xss.spec.js b/cypress/integration/other/xss.spec.js index a550b6783..7f2ea8d4d 100644 --- a/cypress/integration/other/xss.spec.js +++ b/cypress/integration/other/xss.spec.js @@ -9,8 +9,27 @@ describe('XSS', () => { const url = mermaidUrl(str,{}, true); cy.visit(url); + cy.wait(1000).then(()=>{ + cy.get('.mermaid').should('exist'); + }); cy.get('svg') - cy.percySnapshot() + // cy.percySnapshot() + + }) + it('should handle xss in tags in non-html mode', () => { + const str = 'eyJjb2RlIjoiXG5ncmFwaCBMUlxuICAgICAgQi0tPkQoPGltZyBvbmVycm9yPWxvY2F0aW9uPWBqYXZhc2NyaXB0XFx1MDAzYXhzc0F0dGFja1xcdTAwMjhkb2N1bWVudC5kb21haW5cXHUwMDI5YCBzcmM9eD4pOyIsIm1lcm1haWQiOnsidGhlbWUiOiJkZWZhdWx0IiwiZmxvd2NoYXJ0Ijp7Imh0bWxMYWJlbHMiOmZhbHNlfX19'; + + const url = mermaidUrl(str,{ + "theme": "default", + "flowchart": { + "htmlMode": false + } + }, true); + + cy.visit(url); + // cy.get('svg') + // cy.percySnapshot() + cy.get('.malware').should('not.exist'); }) }) diff --git a/cypress/integration/rendering/gitGraph.spec.js b/cypress/integration/rendering/gitGraph.spec.js index 0a72cdee2..47d7bce9d 100644 --- a/cypress/integration/rendering/gitGraph.spec.js +++ b/cypress/integration/rendering/gitGraph.spec.js @@ -2,20 +2,20 @@ import { imgSnapshotTest } from '../../helpers/util.js'; describe('Sequencediagram', () => { - it('should render a simple git graph', () => { - imgSnapshotTest( - ` - gitGraph: - commit - branch newbranch - checkout newbranch - commit - commit - checkout master - commit - commit - merge newbranch`, - { logLevel: 0 } - ); - }); + // it('should render a simple git graph', () => { + // imgSnapshotTest( + // ` + // gitGraph: + // commit + // branch newbranch + // checkout newbranch + // commit + // commit + // checkout master + // commit + // commit + // merge newbranch`, + // { logLevel: 0 } + // ); + // }); }); diff --git a/cypress/platform/current.html b/cypress/platform/current.html index a1d3f0774..283deff93 100644 --- a/cypress/platform/current.html +++ b/cypress/platform/current.html @@ -4,29 +4,33 @@ href="https://fonts.googleapis.com/css?family=Montserrat&display=swap" rel="stylesheet" /> +

info below

-
stateDiagram - [*] --> State1 - State1 --> State2 : Transition 1 - State1 --> State3 : Transition 2 - State1 --> State4 : Transition 3 - State1 --> State5 : Transition 4 - State2 --> State3 : Transition 5 - State1 --> [*] +
graph TD + A ==> B + A --> C + A -.-> D
diff --git a/src/diagrams/flowchart/flowDb.js b/src/diagrams/flowchart/flowDb.js index 7686d0421..a0162b3c9 100644 --- a/src/diagrams/flowchart/flowDb.js +++ b/src/diagrams/flowchart/flowDb.js @@ -22,7 +22,13 @@ let funs = []; const sanitize = text => { let txt = text; - if (config.securityLevel !== 'loose') { + let htmlLabels = true; + if ( + config.flowchart && + (config.flowchart.htmlLabels === false || config.flowchart.htmlLabels === 'false') + ) + htmlLabels = false; + if (config.securityLevel !== 'loose' && htmlLabels) { // eslint-disable-line txt = txt.replace(/
/g, '#br#'); txt = txt.replace(//g, '#br#'); txt = txt.replace(//g, '>'); diff --git a/src/diagrams/flowchart/flowRenderer.js b/src/diagrams/flowchart/flowRenderer.js index ff19ee925..99eda4b3f 100644 --- a/src/diagrams/flowchart/flowRenderer.js +++ b/src/diagrams/flowchart/flowRenderer.js @@ -213,10 +213,10 @@ export const addEdges = function(edges, g) { } break; case 'dotted': - style = 'stroke: #333; fill:none;stroke-width:2px;stroke-dasharray:3;'; + style = 'fill:none;stroke-width:2px;stroke-dasharray:3;'; break; case 'thick': - style = 'stroke: #333; stroke-width: 3.5px;fill:none'; + style = ' stroke-width: 3.5px;fill:none'; break; } }