Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mermaid syntax errors result in large diagrams reducing size dramatically to display the error condition and then the linked markdown source code editor scrolls unexpectedly #208

Open
QuintinWillison opened this issue Jun 30, 2023 · 3 comments

Comments

@QuintinWillison
Copy link

This is perhaps the most annoying thing I've found with this extension so far.

Would it be possible, perhaps, for you to cache the last successfully rendered diagram width and height and then honour that size when rendering the error condition?

Those error conditions are always transitory in nature, quickly fixed by the human who's editing the code.

The unexpected behaviour I'm seeing is that my markdown preview is seemingly triggered the markdown source code editor to scroll 'madly' when it changes size continuously.

Same vibes as when you load a web page and images don't know their width and height beforehand, if you get my drift.

@QuintinWillison
Copy link
Author

Most of my day today has been spent working on a Mermaid document embedded in Markdown with VS Code, and this issue's been doing my head in. For others facing the same frustration there's a VS Code setting which you can disable which stops the preview from influencing the editor scroll position:

Screenshot 2023-06-30 122100

Not a feature I was particularly relying upon in my workflow anyway.

Thanks to this Stackoverflow answer.

@NoCtrlZ1110
Copy link

@QuintinWillison Thank you so much!
That's exactly what I am trying to do, but I don't know how to configure it.

@dalgaarddk
Copy link

Could be ideal if the scrolling disabled whenever the code was invalid.
Without knowing any of the backend code I'd suggest:

  1. Mermaid previewer needs to give feedback to markdown of invalid state
  2. Markdown settings in VSCode to optionally stop scrolling when preview is invalid

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants