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

Weird Mermaid requirement for rendering #54

Open
3 tasks done
brendan-mccoy opened this issue Jun 1, 2021 · 7 comments
Open
3 tasks done

Weird Mermaid requirement for rendering #54

brendan-mccoy opened this issue Jun 1, 2021 · 7 comments
Assignees

Comments

@brendan-mccoy
Copy link

I have checked all the prerequisites below and I'm yet experiencing a problem

  • Read the README.md
  • Have the extended version of Hugo installed
  • Used the exampleSite's config.toml as a reference

Describe the bug

When I try to use mermaid, it only works if the string "mermaid" is in the document outside of tags.

+++
title="Mermaid Test"
+++ 

mermaid
{{< mermaid >}}
pie
  title Key elements in Product X
  "Calcium" : 42.96
  "Potassium" : 50.05
  "Magnesium" : 10.01
  "Iron" :  5
{{< /mermaid >}}

The above works.

+++
title="Mermaid Test"
+++ 

{{< mermaid >}}
pie
  title Key elements in Product X
  "Calcium" : 42.96
  "Potassium" : 50.05
  "Magnesium" : 10.01
  "Iron" :  5
{{< /mermaid >}}

The above doesn't work, and just renders the following text under the title:

pie title Key elements in Product X "Calcium" : 42.96 "Potassium" : 50.05 "Magnesium" : 10.01 "Iron" : 5

I can put the string "mermaid" anywhere and it works, but it doesn't seem this is intentional.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Microsoft Edge Version 91.0.864.37 (Official build) (64-bit)
@onweru
Copy link
Owner

onweru commented Jun 1, 2021

@brendan-mccoy, thank you for bringing this to my attention. I will look into it within the next day.

@onweru onweru self-assigned this Jun 1, 2021
onweru added a commit that referenced this issue Jun 2, 2021
@onweru
Copy link
Owner

onweru commented Jun 2, 2021

@brendan-mccoy, this should work correctly now.

@onweru onweru closed this as completed Jun 2, 2021
@victorpierredev
Copy link

I'm having the same issue. Mermaid won't render unless I add "mermaid" somewhere in the text. Was it fixed?

@onweru
Copy link
Owner

onweru commented Oct 5, 2021

@vpakg, are you using the mermaid shortcode?

@onweru onweru reopened this Oct 5, 2021
@victorpierredev
Copy link

victorpierredev commented Oct 5, 2021

Hi @onweru, thanks for getting back to me. Here is what my Markdown looks like:

---
title: "Mermaid Diagram example"
weight: 1
---
## Flowchart:

{{< mermaid >}}
flowchart TB
  c1-->a2
  subgraph one
  a1-->a2
  end
  subgraph two
  b1-->b2
  end
  subgraph three
  c1-->c2
  end
  one --> two
  three --> two
  two --> c2
{{< /mermaid >}}

this won't render, but if I add the word mermaid anywhere else in the file, it renders properly.

@onweru
Copy link
Owner

onweru commented Oct 6, 2021

@vpakg, I took your code as is and it worked alright. I'm on macos 12, using hugo v0.88.1+extended darwin/arm64. You?

@victorpierredev
Copy link

Hi @onweru I'm in the exact same version as you for Hugo: hugo v0.88.1+extended darwin/amd64
OS: MacOs 11.6 Darwin Kernel Version 20.6.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants