From d23e0e30bbb049819523bd93815f9afa03fc4481 Mon Sep 17 00:00:00 2001 From: Martynas Bagdonas Date: Wed, 17 Feb 2021 10:38:15 +0200 Subject: [PATCH] Fix annotation insertion --- chrome/content/zotero/xpcom/editorInstance.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index a8b8fde9bd..dd90e0e9ca 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -181,6 +181,12 @@ class EditorInstance { if (!attachmentItem) { continue; } + + if (!annotation.text + && !annotation.comment + && !annotation.image) { + continue; + } let citationHTML = ''; let imageHTML = ''; @@ -942,7 +948,7 @@ class EditorInstance { let jsonAnnotations = []; for (let annotation of annotations) { let jsonAnnotation = await Zotero.Annotations.toJSON(annotation); - jsonAnnotation.itemID = attachmentItem.id; + jsonAnnotation.attachmentItemID = attachmentItem.id; jsonAnnotations.push(jsonAnnotation); } let html = `

(${(new Date()).toLocaleString()})

\n`;