hediet / vscode-drawio

This unofficial extension integrates Draw.io (also known as diagrams.net) into VS Code.
https://marketplace.visualstudio.com/items?itemName=hediet.vscode-drawio
GNU General Public License v3.0
9.02k stars 406 forks source link

Can't preview *.drawio in Markdown. #341

Closed wesley-wws closed 1 year ago

wesley-wws commented 1 year ago

Hi,

Thanks for the awsome extension!

I can't preview drawio diagram in Markdown preview, not sure whether it is a bug.

image

Regenhardt commented 1 year ago

Markdown knows everything html knows, so to display an image it has to b jpg/png/svg and maybe some other image format, but .drawio isn't actually an image format.

You can however create a test.drawio.png file, and drawio will let you edit it and immediately add working png code, while markdown will display the png image.

davea38 commented 1 year ago

Yeah I have been saving files as *.drawio.png and they work as Markdown images :) Svg was the first format I tried but that didn't work (presumably no EXIF info?)

Regenhardt commented 1 year ago

Not sure why svg doesn't work for you, I can use it the same as png: image

davea38 commented 1 year ago

It's because I'm displaying the content in DevOps, not Github or VSCode preview. DevOps does not like SVG

wesley-wws commented 1 year ago

Markdown knows everything html knows, so to display an image it has to b jpg/png/svg and maybe some other image format, but .drawio isn't actually an image format.

You can however create a test.drawio.png file, and drawio will let you edit it and immediately add working png code, while markdown will display the png image.

OK thanks, seems like I have to create a new png file from my .drawio file...

hediet commented 1 year ago

create a new png file from my .drawio file...

You should be able to just rename it. Open the file and save it and then it should be a proper png files.

Just try to use SVG whenever possible.