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

Mermaid diagrams not rendering when page is titled Mermaid #3652

Closed
5 tasks done
FISHMANPET opened this issue Mar 1, 2022 · 2 comments
Closed
5 tasks done

Mermaid diagrams not rendering when page is titled Mermaid #3652

FISHMANPET opened this issue Mar 1, 2022 · 2 comments
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open

Comments

@FISHMANPET
Copy link
Contributor

FISHMANPET commented Mar 1, 2022

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

Pages with the title of Mermaid or mermaid (as defined via the top level header in the md file) do not render mermaid diagrams. If the filename is mermaid.md and no header is defined in the file, the mermaid diagram will render.

Expected behaviour

Mermaid diagrams render on pages titled "Mermaid"

Actual behaviour

Mermaid diagrams do not render on pages titled "Mermaid"

Steps to reproduce

I've created a minimal site that demonstrates the behavior: https://github.com/FISHMANPET/mkdocs-mermaid
I've also hosted it on a webserver, because when you view it that way (rather than mkdocs serve) you will see errors in the browser developer console as well:

Package versions

  • Python: 3.9.5
  • MkDocs: 1.2.3
  • Material: 8.2.3

Configuration

# https://github.com/FISHMANPET/mkdocs-mermaid/blob/main/mkdocs.yml
site_name: My Docs
theme:
  name: material
markdown_extensions:
  - pymdownx.superfences:
      custom_fences:
        - name: mermaid
          class: mermaid
          format: !!python/name:pymdownx.superfences.fence_code_format

System information

  • Operating system: Windows 10
  • Browser: Chrome 98
@squidfunk
Copy link
Owner

squidfunk commented Mar 2, 2022

Thanks for reporting. Exact duplicate of #3596. Explanation and mitigation in #3596 (comment).

Additionally see https://twitter.com/squidfunk/status/1495839268182409216

@squidfunk squidfunk added bug Issue reports a bug not fixable Issue concerns an unfixable bug labels Mar 2, 2022
@squidfunk
Copy link
Owner

@FISHMANPET Funny. After I've read your tweet, I actually came up with a way to fix it, and it's quite simple. The reason is that while reading about this behavior, I realized that we could just add a simple check to mitigate the problem at hand, so it's fixable after all. Sometimes a little time to think about stuff or learn works wonders. Fixed in cfa6474.

@squidfunk squidfunk added resolved Issue is resolved, yet unreleased if open and removed not fixable Issue concerns an unfixable bug labels Mar 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue reports a bug resolved Issue is resolved, yet unreleased if open
Projects
None yet
Development

No branches or pull requests

2 participants