


it matches the regular expression /^(joplin:\/\/|:\/)( on top of the previous resource with the same ID and then tries to save the new resource in the database.the resource id is inside a a in the href attribute.the resource id is inside a img tag in the src attribute.The synch process scans all the notes to populate the note_resource table and uses the following rules to decide that a resource is used by a note:

The Joplin Data API to create a resource don't allow to link it to a note so you must follow the rules of the automatic synch process to create this link. This table is populated automatically during the synch process. Jopling stores the links between resources and notes in the database table note_resource. no linking between resource and note was generating a orphan resource that is automatically deleted after 90 daysĪnd then it is actually deleted during the next synch.This approach was working and this is what I used in my first release 0.1.0.Īfter some testing I realized that after a while the resources where deleted and this was caused by 2 issues: My next approach was to delete the previous resource and then recreate it with the same ID in order to keep the same ID in the note body tag: In the first implementation, I tried to use the PUT resource/:id method documented in the Joplin Data API, but after several attempts to guess the expected input of this function (the input is not documented), I looked into the implementation and I realized it was never implemented. This was happening during the modification of a diagram where I was replacing the previous resource with the new one. Here is the story on how I fixed this issue that I hope can help other plugin developers with their amazing work. In the previous version the image drawn with this plugin was deleted after a while by the automatic process deleteOrphanResources. If you created some diagrams before this release you need to modify the html tag to make it work with the new version: # Previous format I'm releasing the first stable version (v1.0.0) where I fixed the linking between the resource and the note.
