Look for abbreviations for longest possible match first

This commit is contained in:
Aurimas Vinckevicius 2013-09-17 21:41:34 -05:00
parent 38580e2366
commit 6393c3bfe2

View file

@ -419,7 +419,7 @@ Zotero.Cite.getAbbreviation = new function() {
newWord = cat[lcWord];
} else {
// Partial match
for(var k=1; k<=word.length && newWord === undefined; k++) {
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;