From 7f7d78603a3419a32eca8d6423dad96c22d3802a Mon Sep 17 00:00:00 2001 From: Aurimas Vinckevicius Date: Tue, 17 Sep 2013 22:53:04 -0500 Subject: [PATCH] Use the longest abbreviation possible. E.g. Fictional journal "Journal of Annunc Materials" (obviously annunc is not a real word) Use "annunc-":"annunc." substitution instead of "annu-":"annu." resulting in "J. Annunc Mater." instead of "J. Annu. Mater." --- chrome/content/zotero/xpcom/cite.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/chrome/content/zotero/xpcom/cite.js b/chrome/content/zotero/xpcom/cite.js index 24adae2a7c..74d1a05b21 100644 --- a/chrome/content/zotero/xpcom/cite.js +++ b/chrome/content/zotero/xpcom/cite.js @@ -421,13 +421,15 @@ Zotero.Cite.getAbbreviation = new function() { // Partial match for(var k=word.length; k>0 && newWord === undefined; k--) { newWord = cat[lcWord.substr(0, k)+"-"]; - if(newWord && word.length - newWord.length < 1) { - newWord = undefined; - } } } } - + + // Don't substitute with a longer word + if(newWord && word.length - newWord.length < 1) { + newWord = word; + } + // Fall back to full word if(newWord === undefined) newWord = word;