Fix attachment interoperability between win and *nix#2205
Fix attachment interoperability between win and *nix#2205Rokt33r merged 3 commits intoBoostIO:masterfrom
Conversation
|
Hi there, Considering your two todos: First: yes as far is i know the migrateAttachment method is used and is working (at least there is nobody complaining anymore)..
Can you have a look if you can refactor that as well? And test that it still works? @saaguero ?? Otherwise: your PR looks good to me. Thanks for your work :) |
|
Hey @ehhc, the code was easy to follow. I'm going to check about the TODO and see if I can refactor it a little bit, adding unit test and doing the regression test as you proposed. Will check it later today. |
|
I've slightly changed the Finally, I've performed the regression test proposed by @ehhc in both Fedora and Windows 10; seems to be working fine but any additional testing around this is appreciated. |
|
your changes look good to me :) 👍 |
|
I confirmed it works on macOS. |
Proposal for fixing #2139.
The main idea is to:
Allow either / or \ as part of the :storage paths in the markdown content. That way we preserve compatibility with already created documents.
Adjust RegExp in the code to handle this and then sanitize to use OS dependent path separator. This allow us to show images in win and *nix platforms without touching the markdown content (very useful if you version your notes in 3rd party storage like Dropbox)
As a consequence of these changes, no deletion of attachments will happen when opening the note between win and *nix.
It would be very nice to open a PR for making the "deletion of attachments" feature configurable.