diff --git a/chrome/content/zotero/xpcom/editorInstance.js b/chrome/content/zotero/xpcom/editorInstance.js index eec35f901e..5e4bf51774 100644 --- a/chrome/content/zotero/xpcom/editorInstance.js +++ b/chrome/content/zotero/xpcom/editorInstance.js @@ -43,9 +43,6 @@ const DOWNLOADED_IMAGE_TYPE = [ 'image/png' ]; -// Schema version here has to be the same as in note-editor! -const SCHEMA_VERSION = 8; - class EditorInstance { constructor() { this.instanceID = Zotero.Utilities.randomString(); @@ -1258,7 +1255,9 @@ class EditorInstance { let { html: serializedHTML, citationItems } = Zotero.EditorInstanceUtilities.serializeAnnotations(jsonAnnotations, true); html += serializedHTML; citationItems = encodeURIComponent(JSON.stringify(citationItems)); - html = `
${html}
`; + // Note: Update schema version only if using new features + let schemaVersion = 8; + html = `
${html}
`; note.setNote(html); await note.saveTx(); return note; @@ -1552,5 +1551,4 @@ class EditorInstanceUtilities { } Zotero.EditorInstance = EditorInstance; -Zotero.EditorInstance.SCHEMA_VERSION = SCHEMA_VERSION; Zotero.EditorInstanceUtilities = new EditorInstanceUtilities(); diff --git a/test/tests/itemPaneTest.js b/test/tests/itemPaneTest.js index 804445e983..5841ff17ae 100644 --- a/test/tests/itemPaneTest.js +++ b/test/tests/itemPaneTest.js @@ -307,7 +307,11 @@ describe("Item pane", function () { // Wait for asynchronous editor update do { yield Zotero.Promise.delay(10); - } while(noteEditor._editorInstance._iframeWindow.wrappedJSObject.getDataSync().html.replace(/\n/g,'') != `

Test

`); + } while ( + !/

Test<\/p><\/div>/.test( + noteEditor._editorInstance._iframeWindow.wrappedJSObject.getDataSync().html.replace(/\n/g, '') + ) + ); }); });