jakob1111 / dokuwiki-plugin-flowcharts

Add flowcharts and diagrams to Dokuwiki with an incredibly simple syntax
GNU General Public License v2.0
7 stars 8 forks source link

Charts not showing up #17

Open nvcleemp opened 3 years ago

nvcleemp commented 3 years ago

We are having an issue with charts not showing up. Usually the chart will show once we have edited the page and saved the changes. However, if we then reload the page (and on successive page loads) the chart is not shown. Since the chart is rendered correctly the first time, I don't think the issue is with our chart. Below is a small example that exhibits the problem on our system.

<flow>
sequenceDiagram
  autonumber
  participant PT as P Tool
  participant PS as P Server
  participant ow as O webserver
  participant ob as O backoffice
  PT -->>+ PS: request access to site
  PS -->> ow: POST account data
opt New account
  ow -->> ob: create account
end
  ow -->> PS: response: token
  PS -->>- PT: redirect browser to site using token
  PT -->> ow: follows redirect
</flow>

If the chart is not showing, we see the following error message in the console:

Uncaught Error: Parse error on line 1:

^
Expecting 'NEWLINE', 'SPACE', 'GRAPH', got 'EOF'
    at Vt.parseError (mermaid.min.js:24)
    at Vt.parse (mermaid.min.js:24)
    at Dt (mermaid.min.js:34)
    at Object.render (mermaid.min.js:34)
    at a (mermaid.min.js:41)
    at Object.init (mermaid.min.js:41)
    at Ba (mermaid.min.js:34)
    at mermaid.min.js:38

If I look at the page source, then I see that the flow chart code is replaced by an empty <div> tag:

<div class="mermaid"></div>

We are using Hogfather and the flowcharts plugin is updated to the latest version.

flaminggoat commented 3 years ago

I also have this issue.

gabuzom commented 3 years ago

Have the same problem.

Tried to manually update mermaid.min.js to the latest version, and at least, when I reload the page after seeing the flowchart OK for the first time, I got this strange mermaid.js error message "syntax error in graph" (when it rendered well once just saved)

It gets weirder: if I display an old revision of the graph, it will ALWAYS display OK!

I don't quite know what to try now.... Anyone has an idea on how to diagnose/bypass/fix this annoying bug?

jackmcrider commented 3 years ago

For me, it helped adding an empty line before the </flow>

ddchrist commented 3 years ago

Tested your example with latest commit on Hogfather with succes :) and purpose an issue close.