commit 7f7d78603a3419a32eca8d6423dad96c22d3802a
parent a55f9b624e2ffa4dccac1f222df53bdd59217c71
Author: Aurimas Vinckevicius <aurimas.dev@gmail.com>
Date: Tue, 17 Sep 2013 22:53:04 -0500
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."
Diffstat:
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git 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;