Closed gerroon closed 1 year ago
I think I also have another plausible explanation
Joplin records full paths to resources if you copy an image from a note and paste to another one
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
I provided all the info already
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
This is is not fixed and it is a major bug.
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? If you require support or are requesting an enhancement or feature then please create a topic on the Joplin forum. This issue may be closed if no further activity occurs. You may comment on the issue and I will leave it open. Thank you for your contributions.
It is not fixed and still a big bug
It happened to me lately. https://github.com/laurent22/joplin/issues/6570 Same problem. I agree with you. I also found out that joplin on windows is using absolute path to images.
This is still a severe bug and is not fixed...
https://discourse.joplinapp.org/t/why-is-github-issues-long-left-to-be-answered/25993/8
seems like the bug is not easily reproduce. I found a way to avoid it. Paste the images into the markdown editor
If anyone is having this issue, please could you provide the exact steps to follow to replicate it? Also please provide your operating system and Joplin version number.
Copy and paste from the forum.
I can reproduce following the instructions/clues from the GitHub issue.
- Create a new note and attach an image to it.
- Copy the image with Ctrl+C using the WYSIWYG mode.
- Create yet another note and paste the image with Ctrl+V using the Markdown mode.
Joplin v2.8.8 under Windows 10.
Joplin 2.8.8 (prod, win32)
Client ID: 8cafef60dc99413dbaf031791993c722
Sync Version: 3
Profile Version: 41
Keychain Supported: Yes
Revision: c2a6a13
@tomasz1986, I can indeed replicate this, but I don't think that's the problem they have, and it's probably not that common to copy from Rich Text editor to Markdown one. It seems to be some issue with Windows paths, but I'd need to try on Windows to replicate
This becomes an issue when the user tries different clients on different platforms or shares between different users of Joplin or users of the system the paths change.
@gerroon Do you have some non-ASCII characters in your Windows username ? If it is the case, I may have found your bug.
Steps to reproduce:
I have written a fix for this bug. I will make a PR and link your issue if you confirm that it is your bug.
@gerroon Do you have some non-ASCII characters in your Windows username ? If it is the case, I may have found your bug.
Steps to reproduce:
1. The Joplin resource directory path must contain some non-ASCII characters. 2. Create a new note. 3. Using the markdown editor, attach an image to the note. 4. Switch to the WYSIWYG editor and make some changes to the note (e.g. add some text below the image) 5. Switch back to markdown. The link to the image is now the full windows path (C:/ ...)
I have written a fix for this bug. I will make a PR and link your issue if you confirm that it is your bug.
Hi
All my user names are regular ascii. What you found sounds like a different bug. This issue is about copying and pasting image using the rich markdown editor which pastes with absolute paths which leads to broken images on other clients and platforms.
I tried the steps in https://github.com/laurent22/joplin/issues/6211#issuecomment-1154139345 and I can reproduce this bug. I'm using the portable version of Joplin v2.9.4 on Windows 10.
Something might be helpful:
onPaste()
in packages/app-desktop/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx
. When I copy then paste an image in WYSIWYG editor, the onPaste()
will handle the ABSOLUTE path even before editor.insertContent(modifiedHtml)
(The modifiedHtml
contains the absolute path)
onPaste()
to convert the absolute path into the internal path, but I failed to track what happens after onPaste()
I guess I've figured out what happens.
Firstly, when copying an image from WYSIWYG editor, you will always get the full path of an image
Then, for WYSIWYG editor(TinyMCE), the onPaste()
will insert the html code of an image in it.
After that, the handler of onChange event will generate the Markdown code based on the html code, by using props.htmlToMarkdown
. The implementation of this function will call Note.replaceResourceExternalToInternalLinks()
to replace the absolute path to the internal path.
For Markdown editor(and other external text editor), the Note.replaceResourceExternalToInternalLinks()
will not be called, so you will only get the absolute path.
When pasting an image copied in WYSIWYG editor to Markdown editor, the editorPaste()
will be called and the clipboardText
is like ![image name](absolute path)
. I think adding something there will fix this issue.
@laurent22, it sounds like @wh201906 pretty much figured out the bug that is causing this issue.
To replicate:
https://github.com/laurent22/joplin/issues/6211#issuecomment-1154139345
Hi
For some reason some images in some of the notes were not synching to other devices. I tried to figure out what the issue was but I can't pinpoint. After even more digging I found that Joplin records absolute Windows paths to the resources which ends up breaking image loading on other devices. Obviously this does not happen always and I do not know when or how Joplin decides to behave this way.
Please see the bottom of the .md content I pasted below. I renamed my user to USER
.jex file ( You can see that those images are not recorded in the resources folder)
Human head - Wikipedia 2.zip
I exported one of the notes I found with that issue, and as you can see the resource has absolute path, this is not something I added myself. This page was captured by the Chrome extension.
This is the page I captured, but I do not know if this is really a Clipper issue since the clipper would not know where the images are saved on the drive.
https://en.wikipedia.org/w/index.php?title=Human_head
As a result of this issue the exported .jex files also does not contain those images which has broken image icons, same with syncing to the other devices where those images are also going to be broken on those devices.
Environment
Joplin version: 2.7.13 Platform: Windows 10