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."
This commit is contained in:
Aurimas Vinckevicius 2013-09-17 22:53:04 -05:00
parent a55f9b624e
commit 7f7d78603a

View file

@ -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;