Code Block Comment

Steps to reproduce

<!--

stateDiagram-v2
    [*] --> Service : Request,Event,etc
    Service --> OPA : Query(any JSON value)
    OPA --> Service : Decision(any JSON value)
    OPA --> Policy(Rego) : Check
    OPA --> Data(JSON) : Check

-->

(I had to surround the start and end of the comment in ` to prevent it from being an actual comment block in the forum)

Expected result

The code block should be commented out.

Actual result

The code block isn’t commented out.

Environment

  • Operating system: MacOS
  • Obsidian version: 0.8.9
1 Like

You can use triple-backticks to instantiate a code block here. Does the following accurately capture the kind of text you’re having trouble with in Obsidian?

<!--
stateDiagram-v2
    [*] --> Service : Request,Event,etc
    Service --> OPA : Query(any JSON value)
    OPA --> Service : Decision(any JSON value)
    OPA --> Policy(Rego) : Check
    OPA --> Data(JSON) : Check
-->

I realised what the issue was… the issue is with the mermaid stateDiagram and the fact that it includes --> which ends the comment block early…

I can still leave the issue open as it would be nice to be able to comment the mermaid code block but I can see how this is such a narrow bug that it can be safely ignored…

Mods, feel free to close the request if deemed not worthy.

2 Likes