Use getExportableNote() for word processor note insertion
This commit is contained in:
parent
eb29b69d58
commit
afa989c3a8
1 changed files with 3 additions and 3 deletions
|
@ -1509,8 +1509,8 @@ Zotero.Integration.Session.prototype._insertCitingResult = async function (field
|
||||||
* placeholder IDs
|
* placeholder IDs
|
||||||
* @param item {Zotero.Item}
|
* @param item {Zotero.Item}
|
||||||
*/
|
*/
|
||||||
Zotero.Integration.Session.prototype._processNote = function (item) {
|
Zotero.Integration.Session.prototype._processNote = async function (item) {
|
||||||
let text = item.getNote();
|
let text = await Zotero.Notes.getExportableNote(item);
|
||||||
let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"]
|
||||||
.createInstance(Components.interfaces.nsIDOMParser);
|
.createInstance(Components.interfaces.nsIDOMParser);
|
||||||
let doc = parser.parseFromString(text, "text/html");
|
let doc = parser.parseFromString(text, "text/html");
|
||||||
|
@ -1551,7 +1551,7 @@ Zotero.Integration.Session.prototype._processNote = function (item) {
|
||||||
};
|
};
|
||||||
|
|
||||||
Zotero.Integration.Session.prototype._insertNoteIntoDocument = async function (fieldIndex, field, noteItem) {
|
Zotero.Integration.Session.prototype._insertNoteIntoDocument = async function (fieldIndex, field, noteItem) {
|
||||||
let [text, citations, placeholderIDs] = this._processNote(noteItem);
|
let [text, citations, placeholderIDs] = await this._processNote(noteItem);
|
||||||
await field.delete();
|
await field.delete();
|
||||||
await this._doc.insertText(text);
|
await this._doc.insertText(text);
|
||||||
if (!citations.length) return [];
|
if (!citations.length) return [];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue