sindrel / excalidraw-converter

A command line tool for porting Excalidraw diagrams to Gliffy and draw.io.
MIT License
93 stars 6 forks source link

Unable to parse input: invalid character '-' in numeric literal #27

Closed alecksalecks closed 11 months ago

alecksalecks commented 11 months ago

Error Message: Unable to parse input: invalid character '-' in numeric literal drawing.zip

I get this error for any drawing created in Excalidraw for Obsidian plugin.

alecksalecks commented 11 months ago

I've found a workaround, I'm copy and pasting the contents of the file into the Excalidraw site. But then I get the error: Unable to parse input: json: cannot unmarshal number 0.5 into Go struct field .elements.strokeWidth of type int64 I can then set the thickness of all these to the lowest setting and then I can save and convert files.

sindrel commented 11 months ago

Hi @alecksalecks! Thanks for reporting the issue.

The issue with element thickness should now be fixed in the latest release: v1.2.1.

I also looked into the issue with diagrams created in Obsidian. Files created by the Excalidraw for Obsidian plugin seem to be saved in a markdown format designed for Obsidian. This adds some metadata that are unparseable by Excalidraw.

However, if you use the "Export image" dialog in the page you want to save, and choose the "Excalidraw" button, it should be saved in a format that should work (JSON):

image

If you use the latest version of Excalidraw Converter, and use the export dialog, you should be able to convert diagrams without workarounds.

Let me know if it fixes your problem!

alecksalecks commented 11 months ago

Yep that does fix it thanks for the help.