vscode-markdown-preview-enhanced icon indicating copy to clipboard operation
vscode-markdown-preview-enhanced copied to clipboard

[BUG] Mermaid diagrams containing math and MathJax math cannot coexist

Open yarakos95 opened this issue 1 year ago • 1 comments

Describe the bug

The presence of the following two things at the same time will break math in mermaid diagrams:

  • Mermaid diagrams containing math
  • MathJax math

Environment

  • Windows 11
  • VS Code
    Version: 1.98.2 (user setup)
    Commit: ddc367ed5c8936efe395cffeec279b04ffd7db78
    Date: 2025-03-12T13:32:45.399Z
    Electron: 34.2.0
    ElectronBuildId: 11161602
    Chromium: 132.0.6834.196
    Node.js: 20.18.2
    V8: 13.2.152.36-electron.0
    OS: Windows_NT x64 10.0.26100
    
  • Markdown Preview Enhanced: 0.8.18

To reproduce

  1. Configure the following in settings.json:

    "markdown-preview-enhanced.mathRenderingOption": "MathJax",
    
  2. Create a Markdown file like this:

    ```mermaid
    flowchart TD
      test{"$$\frac{1}{2}$$"}
    ```
    
    ```math
    \alpha
    ```
    
  3. Get the following result

    Image

Expected behavior

I'd like to see math in Mermaid diagrams not break even when using MathJax.

Additional context

With KaTeX, this problem does not occur. I get the below result with KaTex. I hope that the same result will be achieved with MathJax.

Image

yarakos95 avatar Mar 26 '25 05:03 yarakos95

hey @shd101wyy , Wanted to jump on this, is it possible to assigned ?

thank you kindly

RafaelJohn9 avatar May 06 '25 09:05 RafaelJohn9