tigion / nvim-asciidoc-preview

A simple AsciiDoc preview while editing AsciiDoc documents in Neovim
MIT License
28 stars 3 forks source link

Bug: Created Diagram (mermaid) does not update #5

Closed cloud-wanderer closed 1 day ago

cloud-wanderer commented 3 days ago

Issue:

If you have a diagram, in my case mermaid, that you'd like to preview, it only renders it once. Any updates are not reflected in the rendered graph.

What i tried:

I tried changing the browser, changing the server converter from js to cmd and other similar things, like disabling the browser cache. None worked.

System:

Steps to reproduce

Use an example document like the following, preview it, then make changes to the graph. You will see that the text version updates, but not the rendered graph.

= Diagram Mermaid Sample

.Mermaid graph
[source,zsh]
----
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[Car]
D --> E
D --> E
----
tigion commented 2 days ago

Hm ... I can't reproduce the error. If I use your example in an Asciidoctor file like this (Diagram Blocks):

.Mermaid graph
[mermaid]
// [mermaid, "example-mermaid", svg]
....
graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[Car]
D --> E
D --> E
....

It is displayed correctly and after a change and saving, the change is also displayed correctly in the preview.

How is the diagram integrated in the Asciidoctor file?

[!NOTE] The preview is updated every time the AsciiDoc file is saved.

cloud-wanderer commented 2 days ago

bug

This is indeed a bit odd. I tried to showcase it in the attached recording. On the bottom you see chrome, on the right is Firefox.

You can see me editing, saving then it updates - but only the text. The picture might be a bit small, but you see that the text changes, the pages refresh (text got longer) but nothing happens to the graph.

Chrome is a fresh install, no changes.

tigion commented 1 day ago

Please send me your AsciiDoc file (content as a code block or file as an attachment) so that I can test it with your exact example.

cloud-wanderer commented 1 day ago

EDIT: I found the issue. It seems it is a caching issue on mac, although i am not sure what caused it. I reinstalled asciidoctor, node, chrome, Firefox via brew and it is gone.

cloud-wanderer commented 1 day ago

Closed by author, as reason could not be found, but was solved after reinstalling all dependencies on Mac via brew