commit e51434416a66ea639ebbc87aa4aa9ada50d829c1 parent 193b10a1f5e2b70ad05774d1970c0bcb482f65e7 Author: Simon Kornblith <simon@simonster.com> Date: Thu, 4 Apr 2013 11:11:03 -0400 Fix abbreviation of single word titles https://forums.zotero.org/discussion/28687/ Diffstat:
| M | 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 @@ -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) {