laurent22 / joplin

Joplin - the secure note taking and to-do app with synchronisation capabilities for Windows, macOS, Linux, Android and iOS.
https://joplinapp.org
Other
44.25k stars 4.79k forks source link

Images missing when pasting into webapps and some desktop apps from Joplin #10095

Open personalizedrefrigerator opened 4 months ago

personalizedrefrigerator commented 4 months ago

Operating system

Linux

Joplin version

2.14

Desktop version info

No response

Current behaviour

See the corresponding forum issue.

Currently, many apps can't paste the images copied from Joplin's rich text editor or markdown preview pane.

On Linux:

On Windows,

Possible reason why this is happening

I think it's because text copied to the clipboard (at least from the rich text editor) looks like this to a website:

{
   'text/html': '<div id="rendered-md">\n<p>The following is a&nbsp;<strong>test</strong> image:</p>\n<p><img src="file:///home/primary/.config/joplin-desktop/resources/bdef250506d9444cabe9f190358c8b98.png" alt="Screenshot from 2024-03-06 07-23-02.png"></p>\n<p>&nbsp;</p>\n<p>This is a test.</p>\n</div>',
   'text/plain': 'The following is a **test** image:\n\n![Screenshot from 2024-03-06 07-23-02.png](file:///home/primary/.config/joplin-desktop/resources/bdef250506d9444cabe9f190358c8b98.png)\n\n&nbsp;\n\nThis is a test.',
   'files': Empty FileList
}

Notice that above, the <img tags are specifie using file:// URLs, which can't be accessed by most/all websites.

Expected behaviour

No response

Logs

No response

dgbkn commented 4 months ago

@personalizedrefrigerator maybe we can use data:image/png;base64 urls for loading the image in this way image would be copied correctly including the other content to be fixed,would it be right to do so?

personalizedrefrigerator commented 4 months ago

maybe we can use data:image/png;base64 urls for loading the image in this way image would be copied correctly including the other content to be fixed,would it be right to do so?

Good idea! I think that would work. Here's a list of considerations for this:

Edit: Adjusted formatting.

Niharika0104 commented 3 months ago

can I work on this issue?

PackElend commented 3 months ago

we don't assign issues, if you feel doing it, simply do it