Skip to content

mermaid.js diagram with math typesetting #7046

Closed Answered by squidfunk
haykh asked this question in Q&A
Discussion options

You must be logged in to vote

Yes, as said, I recommend not to use our native integration which is only enabled when a code block tagged with the CSS .mermaid class is found, but add your own integration similar to how we do it by using SuperFences:

markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid-custom # <- anything but "mermaid", which is used by our native integration
          format: !!python/name:pymdownx.superfences.fence_code_format

Then, in JavaScript, look for code blocks with the class .mermaid-custom and register Mermaid.js as needed.

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@haykh
Comment options

@squidfunk
Comment options

@haykh
Comment options

@squidfunk
Comment options

Answer selected by haykh
@squidfunk
Comment options

@haykh
Comment options

@vedranmiletic
Comment options

@haykh
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants