question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax Error Due to Incorrect Generated HTML File

See original GitHub issue

Not sure if this issue is being faced by me or others as well. Mermaid diagrams won’t render for me no matter what - I checked my formatting, syntax, etc, but kept getting the Syntax Error image.

image

After checking the generated HTML files, I saw the HTML code was generated as follows.

<pre><code class="mermaid">graph TD
  A[Client] --&gt; B[Load Balancer]
  B --&gt; C[Server01]
  B --&gt; D[Server02]
</code></pre>

As you can see, it shows up as <code> ... </code>. I manually changed it to <div>...</div> and the diagrams generated just fine.

<pre><div class="mermaid">graph TD
  A[Client] --&gt; B[Load Balancer]
  B --&gt; C[Server01]
  B --&gt; D[Server02]
</div></pre>

image

Running mkdocs build reverts it back to code and so syntax errors start occurring again.

Attaching my yml file for reference:

site_name: My Documentation
nav:
  - Home: index.md
  - Modules: modules.md
theme: readthedocs
plugins:
  - search
  - mermaid2
extra_javascript:
  - https://unpkg.com/mermaid/dist/mermaid.min.js
markdown_extensions:
  - admonition

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:39 (16 by maintainers)

github_iconTop GitHub Comments

1reaction
mrRobot62commented, Sep 4, 2020

@kerrerain I checked it with YOUR code - and - bam - error

checked MkDocs.yml file tataaa: found the problem

try this:

site_name: Issue 11 of mkdocs-mermaid2-plugin
site_author: kerrerain
copyright: Copyright kerrerain, &copy; 2020

theme:
   name: material
nav:
  - Home: index.md

plugins:
  - search
  - mermaid2:
      version: 8.7.0

IMPORTANT Your have to install before: pip install mkdocs-material

and than :

image

0reactions
fralaucommented, Sep 5, 2020

This is understood: I will close this issue because the immediate concern (“bug”) was solved by a workaround (use superfences + custom fences).

I opened an new issue (#16) for the enhancement request (to make the default configuration work with most themes).

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML code generates syntax error but still works
An iframe is supposed to have a src attribute, and the content of that URL will be rendered into the <iframe> element. The...
Read more >
How to check for errors in HTML ? - GeeksforGeeks
Syntax error : Incorrect syntax leading to compile time error in other languages.HTML have no affect of syntax error. Logical error: Syntax ...
Read more >
Invalid Syntax in Python: Common Reasons for SyntaxError
If the interpreter can't parse your Python code successfully, then this means that you used invalid syntax somewhere in your code. The interpreter...
Read more >
Debugging HTML - Learn web development | MDN
HTML itself doesn't suffer from syntax errors because browsers parse it permissively, meaning that the page still displays even if there are ...
Read more >
Error Explanations for The W3C Markup Validation Service
This error may appear if you are using a bad syntax for your comments, such as "<!invalid comment>" The proper syntax for comments...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found