From ea12afa045042a2e6042648c2c31b8caecdada3c Mon Sep 17 00:00:00 2001 From: Simon Kornblith Date: Thu, 4 Apr 2013 11:11:03 -0400 Subject: [PATCH] Fix abbreviation of single word titles https://forums.zotero.org/discussion/28687/ --- chrome/content/zotero/xpcom/cite.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index 5087396036..feac5889eb 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -429,12 +429,14 @@ Zotero.Cite.getAbbreviation = new function() { } // Fall back to full word - if(newWord === undefined ) newWord = word; + if(newWord === undefined) newWord = word; words[j] = newWord.substr(0, 1).toUpperCase() + newWord.substr(1); } + abbreviation = words.join("").replace(/\s+/g, " ").trim(); + } else { + abbreviation = key; } - abbreviation = words.join("").replace(/\s+/g, " ").trim(); } if(!abbreviation || abbreviation === key) {