Weird copy/paste problem on Ubuntu from Zotero to Obsidian

Once you’ve done the above, delete everything above this line.
When copying from a Zotero Annotation note to Obsidian, the resulting pasted material is completely messed up. It looks a bit like HTML but not exactly. This only seems to happen with Obsidian – pasting into Libre Office, for example, pastes correctly. This happens with fresh installs of Zotero 6 (using the tarball from their website) and fresh install of Obsidian (using the snap package).

Weirdly, copying from Libre Office into Obsidian works. Just not directly from Zotero to Obsidian.

Steps to reproduce

  1. Select everything in a Zotero Annotations Note. Ctrl-C to copy it to the clipboard.
  2. Open new note in Obsidian (I used a daily note but it makes no difference)
  3. Paste clipboard material into Obsidian.

Did you follow the troubleshooting guide? [Y/N]

Yes

Expected result

Properly rendered text and images. I’ve attached a correctly formatted screenshot from Windows (see attached)

Actual result


Improperly formatted text and image rendered as text. See attached screenshot.

Environment

SYSTEM INFO:
Obsidian version: v1.5.8
Installer version: v1.5.8
Operating system: #107-Ubuntu SMP Wed Feb 7 13:26:48 UTC 2024 5.15.0-97-generic
Login status: not logged in
Insider build toggle: off
Live preview: on
Base theme: dark
Community theme: none
Snippets enabled: 0
Restricted mode: off
Plugins installed: 3
Plugins enabled: 2
1: Calendar v1.5.10
2: Reminder v1.1.15

RECOMMENDATIONS:
Community plugins: for bugs, please first try updating all your plugins to latest. If still not fixed, please try to make the issue happen in the Sandbox Vault or disable community plugins.


Additional information

I tried this on both Ubuntu 22.04 (LTS) as well as Ubuntu 23.10. Both have the same issue.

It’s a rich text format, I think.

Start here and follow the links, and I think you’ll find the solution, so the notes will be imported as markdown: Available for beta testing: Markdown export of notes - Page 4 - Zotero Forums

Also, see this for an explanation on the long “messed up” string, which is a base64 encoded version of the note image: Export notes including image - Zotero Forums

To avoid this issue with base64 images, my suggestion would be to use the Zotero Integration plugin to import your notes, images and annotations from Zotero into Obsidian. The solution in the first link will give you markdown instead of rich text, but I think the images will still be base64 - hence this alternative solution.

Seems html with base64 encoded images in it.

moved to help.

You will likely be able to paste unformatted text using Ctrl+Shift+V.

Thank you for the response. Looking over the links provided in Feralflora’s response, I still think there’s a bug report here that’s being overlooked, because pasting the same content (including images) from Libre Office works fine but not from Zotero. It also works fine on the Windows version of Obsidian. Just not on Ubuntu.

I’ll try the links and report back.

What I hoped you would gather from the link was to disable the following Obsidian setting > Editor > “Auto convert HTML”.

However, upon testing your reproduction steps, I can’t get the same result whether this setting is enabled or disabled. The difference it makes for me, is that functional links to Zotero are only included if I disable “Auto convert HTML”.

You probably need to got to Zotero → Settings → Export → Quick Copy → Note Format and change it from HTML to Markdown + Rich text:

image

I checked and it’s already set for Markdown and Rich Text.
Screenshot_2024-03-12_10-50-57

When I turn off “Auto convert HTML”, the text pastes fine but the rectangle selection/image doesn’t get copied at all, which is not really fixing the problem. Copying from Libre Office as a workaround gets me the image (but also kills the reference links).

When you say you cannot reproduce the error, does that mean you’re actually getting an image rendered correctly when you Ctrl-C/Ctrl-V copy and paste from Zotero to Obsidian? If so, what’s your setup?