Open netthier opened 2 years ago
Is there any precedent for this sort of thing with code fencing / rendering?
How have other addressed it?
I have no clue, I just opened this issue because Mermaid generated a pretty large flowchart which got cut off.
I need to be able to scale the diagrams as well. As it stands, generated diagrams (BPMN) are very often too wide for the screen, and there is no scrollbar in the preview either.
Perhaps you could use Obsidian's own image resize feature? See https://help.obsidian.md/How+to/Embed+files#Resize+images
Ideally, It would be best if images wider than the allowed width would auto-scale to fit width, and when clicked could open up a larger window. The first part should be doable, I think, with what you already have.
I kindof solved this by making the mermaid field scollable from left to right (as it did not do it for me on default) with a css snippet:
.mermaid {
white-space: pre;
overflow-x:auto;
}
In some cases Kroki generates diagrams wider than the page, which leads to display issues when switching to the reading mode or exporting to PDF. There should be a way to manually scale down generated diagrams without adding DSL-specific styling. An option to automatically scale the image to fit would also be useful.