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:
Aurimas Vinckevicius 2015-05-12 18:36:27 -05:00
parent f6083068cd
commit c84a16984b
2 changed files with 6 additions and 0 deletions

View file

@ -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
var extra = zoteroItem.extra;
if(typeof extra === "string") {

View file

@ -207,6 +207,7 @@ describe("Zotero.Utilities", function() {
let cslJSONNote = Zotero.Utilities.itemToCSLJSON(note);
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() {
let file = getTestDataDirectory();