Skip to content

When using fence mode, securityLevel will not be set #108

@evan361425

Description

@evan361425

mkdocs.yaml:

markdown_extensions:
- pymdownx.superfences:
    custom_fences:
    - name: mermaid
      class: mermaid
      format: !!python/name:mermaid2.fence_mermaid_custom
plugins:
- mermaid2:
    arguments:
      securityLevel: loose

when using above config, the dialog will not support html:

flowchart
  A[long<br>text] --> B

My currently workaround will be set theme by JS and disable the fence method.
However this method will cause the theme of dialog not changed after changing the theme of site (as document mentioned).

markdown_extensions:
# remove below setting
# - pymdownx.superfences:
plugins
- mermaid2:
    arguments:
      securityLevel: loose
      theme: |
        ^(JSON.parse(__md_get("__palette").index == 1)) ? 'dark' : 'light'

Metadata

Metadata

Assignees

No one assigned

    Labels

    mermaid-jsThis isssue relates to the mermaid javascript library

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions