From 5493fadc9e6fdedb0136a71768bf956048820587 Mon Sep 17 00:00:00 2001 From: Marc Faber Date: Mon, 13 Jan 2020 22:04:47 +0100 Subject: [PATCH] #1200 Unify regex for finding
tags throughout mermaid --- .../rendering/stateDiagram.spec.js | 12 +++ dist/index.html | 77 ++++++++++--------- src/diagrams/flowchart/flowRenderer.js | 4 +- src/diagrams/flowchart/flowRenderer.spec.js | 41 +++++++++- src/diagrams/state/shapes.js | 6 +- src/diagrams/state/stateDiagram.spec.js | 10 +++ src/diagrams/state/stateRenderer.js | 2 +- src/mermaid.js | 2 +- src/utils.js | 3 +- 9 files changed, 112 insertions(+), 45 deletions(-) diff --git a/cypress/integration/rendering/stateDiagram.spec.js b/cypress/integration/rendering/stateDiagram.spec.js index 0ab68713e..3e0bf1e1c 100644 --- a/cypress/integration/rendering/stateDiagram.spec.js +++ b/cypress/integration/rendering/stateDiagram.spec.js @@ -121,6 +121,18 @@ describe('State diagram', () => { {} ); }); + it('should handle multiline notes with different line breaks', () => { + imgSnapshotTest( + ` + stateDiagram + State1 + note right of State1 + Line1
Line2
Line3
Line4
Line5 + end note + `, + {} + ); + }); it('should render a states with descriptions including multi-line descriptions', () => { imgSnapshotTest( diff --git a/dist/index.html b/dist/index.html index 4acc24c4f..9f5df50d6 100644 --- a/dist/index.html +++ b/dist/index.html @@ -519,45 +519,46 @@ class Class10 { int id size() } - + -
- classDiagram - Class01~T~ <|-- AveryLongClass : Cool - <<interface>> Class01 - Class03~T~ "0" *-- "0..n" Class04 - Class05 "1" o-- "many" Class06 - Class07~T~ .. Class08 - Class09 "many" --> "1" C2 : Where am i? - Class09 "0" --* "1..n" C3 - Class09 --|> Class07 - Class07 : equals() - Class07 : Object[] elementData - Class01 : #size() - Class01 : -int chimp - Class01 : +int gorilla - Class08 <--> C2: Cool label - class Class10 { - <<service>> - int id - size() - } -
+
+ classDiagram + Class01~T~ <|-- AveryLongClass : Cool + <<interface>> Class01 + Class03~T~ "0" *-- "0..n" Class04 + Class05 "1" o-- "many" Class06 + Class07~T~ .. Class08 + Class09 "many" --> "1" C2 : Where am i? + Class09 "0" --* "1..n" C3 + Class09 --|> Class07 + Class07 : equals() + Class07 : Object[] elementData + Class01 : #size() + Class01 : -int chimp + Class01 : +int gorilla + Class08 <--> C2: Cool label + class Class10 { + <<service>> + int id + size() + } +
stateDiagram State1 -
+ -
-
- stateDiagram - [*] --> First - state First { - [*] --> second - second --> [*] - } -
+
+ +
+ stateDiagram + [*] --> First + state First { + [*] --> second + second --> [*] + } +
stateDiagram State1: The state with a note @@ -567,8 +568,14 @@ class Class10 { end note State1 --> State2 note left of State2 : This is the note to the left. -
- + +
+ stateDiagram + State1 + note right of State1 + Line1
Line2
Line3
Line4
Line5 + end note +