squidfunk / mkdocs-material

Documentation that simply works

Home Page:https://squidfunk.github.io/mkdocs-material/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Python-Markdown extension "extra" is not compatible with mermaid

intzaaa opened this issue · comments

commented

Contribution guidelines

I've found a bug and checked that ...

  • ... the problem doesn't occur with the mkdocs or readthedocs themes
  • ... the problem persists when all overrides are removed, i.e. custom_dir, extra_javascript and extra_css
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem

Description

If I enable extra like this:

markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - extra

Mermaid.js will not work.

Expected behaviour

Diagrams display correctly.

image

Actual behaviour

Only see the code.

Steps to reproduce

1.Enable extra
2.Enable mermaid in pymdownx.superfences

Package versions

  • Python: 3.10
  • MkDocs: 1.3.0
  • Material: 8.3.6

Configuration

plugins:
  - git-revision-date
  - tags:
      tags_file: art/tags.md
  - search:
      lang:
        - en
        - ja
      separator: '[\s\u200b\-]'
markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format
  - footnotes
  - md_in_html
  - attr_list
  - pymdownx.emoji:
      emoji_index: !!python/name:materialx.emoji.twemoji
      emoji_generator: !!python/name:materialx.emoji.to_svg
  - pymdownx.tasklist:
      custom_checkbox: true
  - pymdownx.smartsymbols
  - pymdownx.snippets
  - pymdownx.details
  - pymdownx.caret
  - pymdownx.mark
  - pymdownx.tilde
  - pymdownx.betterem
  - pymdownx.arithmatex:
      generic: true
  - admonition
!  - extra
  - tables
  - smarty
theme:
  features:
    - search.suggest
    - search.highlight
    - navigation.tracking
    - navigation.instant
    #  navigation.top
    - navigation.expand
    - navigation.sections
    # toc.integrate
    - navigation.tabs
    - navigation.tabs.sticky
  font: false
  palette:
    - scheme: default
      primary: indigo
      accent: indigo
      toggle:
        icon: material/toggle-switch
        name: 切换到暗黑模式
    - scheme: slate
      primary: indigo
      accent: indigo
      toggle:
        icon: material/toggle-switch-off-outline
        name: 切换到明亮模式
  name: material
  logo: load/logo/LOGO.png
  favicon: load/logo/LOGO.png
  locale: zh_CN
  language: zh
extra_javascript:
  # load/javascripts/mermaid.min.js
  - load/javascripts/mathjax.js
  - load/javascripts/polyfill.min.js?features=es6
  - load/javascripts/es5/tex-mml-chtml.js
  - load/javascripts/es5/tex-chtml-full.js
  # load/javascripts/es5/tex-svg-full.js
  # load/javascripts/es5/tex-mml-svg.js
extra_css:
  - load/fonts/stylesheet.css


### System information

- Operating system: Ubuntu 22.0.4
- Browser: Edge 102

Thanks for reporting! This is expected. extra enables the fenced_code_block extension, which is incompatible with pymdownx.highlight. We don't support fenced_code_blocks anymore.