hackmd-io-issues icon indicating copy to clipboard operation
hackmd-io-issues copied to clipboard

Mermaid gitGraph preview will not render correctly

Open FlandreDaisuki opened this issue 2 years ago • 0 comments

Is this a hackmd.io issue?

  • [x] Yes, the bug happens on https://hackmd.io
  • [ ] No. If it's a self-hosted CodiMD instance, please fire up the issue in the repo of CodiMD: https://github.com/hackmdio/codimd

Read our Official tutorial

  • [x] done

What's the problem

The mermaid preview to gitGraph diagram will not render at the first time in edit + preview split mode. If i type a space and delete it, it can render the graph on preview side.

However, in preview mode, there are no chance to make this kind of change. So, it won't be rendered.

Current behaviour

at first time after type a space and delete it

Provide steps to reproduce:

  1. Go to https://hackmd.io/sL497ZI0QfqtAhnancnCtQ?both
  2. There are no rendered result in preview side.
  3. Type a space in mermaid code block
  4. Delete the space you typed
  5. See the correct rendering result

If possible, create a note with reproducible content and share the link with us.

  1. https://hackmd.io/sL497ZI0QfqtAhnancnCtQ?both
  2. https://hackmd.io/@flandrekawaii/HackMD-Mermaid-Diagram-Preview-Repro

Expected behaviour

  1. I can see correct rendering result in preview side before I type anything while accessing https://hackmd.io/sL497ZI0QfqtAhnancnCtQ?both
  2. I can see correct rendering result in https://hackmd.io/@flandrekawaii/HackMD-Mermaid-Diagram-Preview-Repro

Environment

I use HackMD on:

Desktop

  • OS: macOS
  • Browser:
    • Firefox 108.0.2 (64bit)
    • Microsoft Edge 109.0.1518.52 (x86_64)

FlandreDaisuki avatar Jan 16 '23 06:01 FlandreDaisuki