Open 9j7axvsLuF opened 1 year ago
I found a (perhaps hacky) solution: converting the content of the note from markdown to html using the markdown
package before passing it to Zotero, like so:
note_content = markdown.markdown(note_content)
There might be a better way to do this though!
It looks like the escaping is being inserted on the server side. Here's the JSON Pyzotero sends in its POST request:
{"itemType": "note", "note": "# Note Title\n\nThis is a note.", "tags": [], "collections": [], "relations": {}}
I'll see whether someone on the Zotero side knows what's going on.
Thanks for the quick response! In any case the html trick shared above works great. Perhaps there could be args in a future version of pyzotero to automatically handle the markdown-to-html conversion for markdown content, or at least something in the docs to explain how to preserve formatting (unless, of course, Zotero decides to change their API).
When creating notes using
pyzotero
, the markdown formatting isn't being recognized. I've followed the documentation closely, but the created notes show markdown characters (such as#
) instead of rendering them as intended, and collapse line breaks (\n
) into whitespaces.Here's a simplified Python code snippet to demonstrate the issue:
The created note should render the markdown formatting, displaying as follows in Zotero:
Instead, this is what I see:
When I export the resulting note in markdown, I get this with the hash symbol escaped:
At the very least I would like my created notes to respect line breaks in the content, otherwise the notes are unreadable in Zotero.
Additional Context:
pyzotero
version: 1.5.10