TiddlyDesktop icon indicating copy to clipboard operation
TiddlyDesktop copied to clipboard

_canonical_uri issue with Drag and Drop external files on Windows 10

Open msalty opened this issue 4 years ago • 1 comments

When I drag and drop an image file into a fresh Tiddlywiki (v5.1.21) in TiddlyDesktop on Windows 10 the auto-generated _canonical_uri is incorrect. If I open the tiddler containing the imported image, I received the 'broken-image-link' thumbnail. If I delete a single period from the front of the auto-generated _canonical_uri, the image shortcut is fixed.

Example Directory Structure: Tiddlywiki.html | | -- images\ example.jpg

If I drag and drop "example.jpg" into Tiddlywiki.html in TiddlyDesktop, the auto generated _canonical_uri is currently "../images/example.jpg" (note the leading double periods) and the image is not displayed properly in the resulting tiddler. If I remove a single leading period (to indicate current directory), the image link is corrected and the image is displayed properly. I have tested this on a couple machines and the behavior is the same on both. The auto-generated _canonical_uri is always one directory higher than the actual path of the file is.

msalty avatar Oct 24 '19 22:10 msalty

I also have this issue using TiddlyDesktop-linux64-v0.0.14. Everytime I drag and drop an external attachment, I need to fix the _canonical_uri to remove and additional leading period

A temporary fix for me was to edit https://github.com/Jermolene/TiddlyWiki5/blob/41a7d98e17470d23164420c0235b10f717a7a009/plugins/tiddlywiki/external-attachments/startup.js#L97 reducing in one iteration the loop (rootParts.length-1)

victorpreuss avatar May 27 '20 03:05 victorpreuss