fix issues with initials with periods

This commit is contained in:
Simon Kornblith 2007-03-23 13:55:55 +00:00
parent c6bc536f64
commit f3664a8c6e

View File

@ -45,6 +45,7 @@ Zotero.Utilities.prototype.strToDate = function(date) {
/*
* Cleans extraneous punctuation off an author name
*/
Zotero.Utilities._allCapsRe = /^[A-Z]+$/;
Zotero.Utilities.prototype.cleanAuthor = function(author, type, useComma) {
if(typeof(author) != "string") {
throw "cleanAuthor: author must be a string";
@ -70,7 +71,7 @@ Zotero.Utilities.prototype.cleanAuthor = function(author, type, useComma) {
var firstName = author.substring(0, spaceIndex);
}
if(firstName && firstName.toUpperCase() == firstName &&
if(firstName && Zotero.Utilities._allCapsRe.test(firstName) &&
firstName.length <= 4 && lastName.toUpperCase() != lastName) {
// first name is probably initials
var newFirstName = "";