Map note excerpt to title in itemToCSLJSON
This way notes have some sort of user-friendly way of being traced from Word documents to Zotero items in the library
This commit is contained in:
parent
f6083068cd
commit
c84a16984b
|
@ -1597,6 +1597,11 @@ Zotero.Utilities = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Special mapping for note title
|
||||||
|
if (zoteroItem.itemType == 'note' && zoteroItem.note) {
|
||||||
|
cslItem.title = Zotero.Notes.noteToTitle(zoteroItem.note);
|
||||||
|
}
|
||||||
|
|
||||||
// extract PMID
|
// extract PMID
|
||||||
var extra = zoteroItem.extra;
|
var extra = zoteroItem.extra;
|
||||||
if(typeof extra === "string") {
|
if(typeof extra === "string") {
|
||||||
|
|
|
@ -207,6 +207,7 @@ describe("Zotero.Utilities", function() {
|
||||||
|
|
||||||
let cslJSONNote = Zotero.Utilities.itemToCSLJSON(note);
|
let cslJSONNote = Zotero.Utilities.itemToCSLJSON(note);
|
||||||
assert.equal(cslJSONNote.type, 'article', 'note is exported as "article"');
|
assert.equal(cslJSONNote.type, 'article', 'note is exported as "article"');
|
||||||
|
assert.equal(cslJSONNote.title, note.getNoteTitle(), 'note title is set to Zotero pseudo-title');
|
||||||
});
|
});
|
||||||
it("should convert standalone attachments to expected format", function() {
|
it("should convert standalone attachments to expected format", function() {
|
||||||
let file = getTestDataDirectory();
|
let file = getTestDataDirectory();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user