What mime type is needed to paste rich text into notes?

Part of my ridiculous note taking setup is to enter the note as markdown in vim then copy it to Zotero. The copy stage is a one-liner that converts the markdown to html via pandoc then copies the html to my system's clipboard. When I paste into Zotero, the result is interpreted as plain text, so I end up with all the markup. However, when I paste into LibreOffice, it's rendered as rich text (the markup is interpreted), which is what I want. Also, I can copy from LibreOffice to Zotero and Zotero will keep the rich text formatting.

I can apparently set the mime type when copying to the clipboard, but the seemingly obvious options (text/html, text/richtext, and text/rtf) don't have any effect in Zotero: the markup always gets pasted. What mime type should I be using to paste rich text? (And if it's not a mime type thing, how does it work from LO to Zotero?)

Thanks!
  • Is this Zotero 5 or the 6 beta?
  • 5.0.96.3 (on Pop OS if that matters)
  • Might be worth just updating to the beta, which has a completely new note editor (and will turn into stable soon). Good chance the notes will just take text/html and display it as such.
  • Exciting stuff! I can't find any references to the 6.0 beta or any binaries for it at a glance, is it just the main branch of the github repo?
  • Oh nevermind, I just found it -- I'll give it a shot!
  • Unfortunately the 6.0 beta has the same pasting behaviour, so I guess my original question stands. The editor looks really slick though!
  • It's HTML. Can't advise beyond that, though. You can inspect the raw contents of the clipboard using some tool and compare the difference between what LO copies and what you're copying.
  • edited February 21, 2022
    It seems like pasting into Zotero's note editor will only translate HTML to rich text if it's an HTML document with the meta http-equiv="content-type" content="text/html; charset=utf-8" tag in the head section (sorry, can't seem to figure out posting HTML tags in this comment editor...). Fragments won't work and defining the encoding in the mime type (ie by setting it to "text/html;charset=utf-8") also doesn't work.
Sign In or Register to comment.