marc0l92 / joplin-plugin-plantUML

Render PlantUML diagram inside your Joplin notes.
MIT License
47 stars 8 forks source link

Can not copy image or image url #19

Open louiscaron opened 1 month ago

louiscaron commented 1 month ago

Hello Marco, I am using your great plugin (so many thanks for that). I have been facing an issue with the copy function (both image and link). The error is the following:

index.html:9 Uncaught (in promise) TypeError: Cannot read properties of null (reading 'dataset')
at HTMLInputElement.<anonymous> (index.html:9:58)

It seems to root in the definition of the diagram variable (https://github.com/marc0l92/joplin-plugin-plantUML/blob/a970be6904be2510bcd9dd7b2012a82c4958ec69/src/contentScript/contentScript.ts#L32) which remains to NULL. I am not familiar with the web development, but by quickly looking, i had the feeling that it should have been initialized here (https://github.com/marc0l92/joplin-plugin-plantUML/blob/a970be6904be2510bcd9dd7b2012a82c4958ec69/src/contentScript/contentScript.ts#L52)

I am not able to tell if this is related to my setup, I can do more tests if you need.

I have done some more tests, and there is another error in the error console:

index.html:22 Uncaught (in promise) TypeError: Assignment to constant variable. at index.html:22:28

which points to this diagram being const:

https://github.com/marc0l92/joplin-plugin-plantUML/blob/a970be6904be2510bcd9dd7b2012a82c4958ec69/src/contentScript/contentScript.ts#L32

could this be the error? i am not familiar with the development environment so i could not test it myself....