From f979ced49d51ef60c7e78a8208adc27e1eefe313 Mon Sep 17 00:00:00 2001 From: NicolasNewman Date: Sat, 24 Jun 2023 16:56:42 +0900 Subject: [PATCH] refactor(katex): revision changes --- demos/sequence.html | 68 +++++++++---------- .../mermaid/src/diagrams/common/common.ts | 2 +- 2 files changed, 35 insertions(+), 35 deletions(-) diff --git a/demos/sequence.html b/demos/sequence.html index 42917743c..784dce322 100644 --- a/demos/sequence.html +++ b/demos/sequence.html @@ -62,41 +62,41 @@
-      sequenceDiagram
-        accTitle: Sequence diagram title is here
-        accDescr: Hello friends
+    sequenceDiagram
+      accTitle: Sequence diagram title is here
+      accDescr: Hello friends
 
-      participant Alice
-      participant Bob
-      participant John as John
Second Line - rect rgb(200, 220, 100) - rect rgb(200, 255, 200) - Alice ->> Bob: Hello Bob, how are you? - Bob-->>John: How about you John? - end - Bob--x Alice: I am good thanks! - Bob-x John: I am good thanks! - Note right of John: John thinks a long
long time, so long
that the text does
not fit on a row. - Bob-->Alice: Checking with John... - Note over John:wrap: John looks like he's still thinking, so Bob prods him a bit. - Bob-x John: Hey John - we're still waiting to know
how you're doing - Note over John:nowrap: John's trying hard not to break his train of thought. - Bob-x John:wrap: John! Are you still debating about how you're doing? How long does it take?? - Note over John: After a few more moments, John
finally snaps out of it. - end - alt either this - Alice->>John: Yes - else or this - Alice->>John: No - else or this will happen - Alice->John: Maybe - end - par this happens in parallel - Alice -->> Bob: Parallel message 1 - and - Alice -->> John: Parallel message 2 - end -
+ participant Alice + participant Bob + participant John as John
Second Line + rect rgb(200, 220, 100) + rect rgb(200, 255, 200) + Alice ->> Bob: Hello Bob, how are you? + Bob-->>John: How about you John? + end + Bob--x Alice: I am good thanks! + Bob-x John: I am good thanks! + Note right of John: John thinks a long
long time, so long
that the text does
not fit on a row. + Bob-->Alice: Checking with John... + Note over John:wrap: John looks like he's still thinking, so Bob prods him a bit. + Bob-x John: Hey John - we're still waiting to know
how you're doing + Note over John:nowrap: John's trying hard not to break his train of thought. + Bob-x John:wrap: John! Are you still debating about how you're doing? How long does it take?? + Note over John: After a few more moments, John
finally snaps out of it. + end + alt either this + Alice->>John: Yes + else or this + Alice->>John: No + else or this will happen + Alice->John: Maybe + end + par this happens in parallel + Alice -->> Bob: Parallel message 1 + and + Alice -->> John: Parallel message 2 + end +
diff --git a/packages/mermaid/src/diagrams/common/common.ts b/packages/mermaid/src/diagrams/common/common.ts
index 22eb61b19..28d29b280 100644
--- a/packages/mermaid/src/diagrams/common/common.ts
+++ b/packages/mermaid/src/diagrams/common/common.ts
@@ -240,7 +240,7 @@ export const calculateMathMLDimensions = async (text: string, config: MermaidCon
  * @returns String containing MathML if KaTeX is supported, or an error message if it is not and stylesheets aren't present
  */
 export const renderKatex = async (text: string, config: MermaidConfig): Promise => {
-  if ((hasKatex(text) && isMathMLSupported()) || (!isMathMLSupported() && config.legacyMathML)) {
+  if (hasKatex(text) && (isMathMLSupported() || config.legacyMathML)) {
     // @ts-ignore @types/katex does not work
     const katex = (await import('katex')).default;
     return text