Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transcluded Mermaid diagrams get mangled if there is indentation #1414

Open
tsbertalan-amgen opened this issue Nov 21, 2024 · 0 comments
Open

Comments

@tsbertalan-amgen
Copy link

Describe the bug

If I ![[transclude]] a document with a mermaid diagram, there seems to be so mangling of greater-than symbols to HTML entities that is connected to indentation in a way I can't quite parse. Is this documented somewhere, so I can know how to avoid it reliably? My solution right now is just not to use indentation in my Mermaid code fences, which is fine enough I guess. Feel free to close this if you think that's enough.

Small Reproducible Example

No response

Steps to Reproduce the Bug or Issue

File src.md:

This is the src.

Transclusion:

![[dst]]

File dst.md (using quad-backticks for this outer fence):

This works:
```mermaid
flowchart LR
A --> B
```

This also works:
```mermaid
flowchart LR
    A --> B
```

This does not:
```mermaid
flowchart LR

    A --> B
```

This is now garbled because the previous:
```mermaid
flowchart LR
A --> B
```

I get this preview for src.md:
image

Expected behavior

Transclusion should look like this:

image

Screenshots or Videos

No response

Operating System Version

Win 10 Enterprise

Visual Studio Code Version

Version: 1.82.2 (system setup) Commit: abd2f3db4bdb28f9e95536dfa84d8479f1eb312d Date: 2023-09-14T05:55:25.390Z Electron: 25.8.1 ElectronBuildId: 23779380 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Windows_NT x64 10.0.19045

Additional context

Some maybe relevant installed extensions:

  • Foam
  • Markdown All in One (Yu Zhang)
  • Markdown Extended (jebbs, kbd plugin disabled)
  • Markdown Preview Mermaid (Matt Bierner)
  • markdownlint
  • Prettier
  • YAML (Red Hat)

I raised this here rather than with Mermaid Preview because the issue occurs only when transcluding dst, not when previewing dst directly (see "Expected behavior" screenshot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant