How to install the newest Mermaid JS libraries?

I’m on version 1.2.7. I just realized the issue happens the first time I switch to “reading-mode” and it persists until I open a different document, and go back to the first document with the Mermaid graph.

In the live-preview it always display the arrows correct.

What else can I do to help to debug this issue?

Edit: I’m on Linux, if this is relevant.