fix issues with initials with periods
This commit is contained in:
parent
c6bc536f64
commit
f3664a8c6e
|
@ -45,6 +45,7 @@ Zotero.Utilities.prototype.strToDate = function(date) {
|
||||||
/*
|
/*
|
||||||
* Cleans extraneous punctuation off an author name
|
* Cleans extraneous punctuation off an author name
|
||||||
*/
|
*/
|
||||||
|
Zotero.Utilities._allCapsRe = /^[A-Z]+$/;
|
||||||
Zotero.Utilities.prototype.cleanAuthor = function(author, type, useComma) {
|
Zotero.Utilities.prototype.cleanAuthor = function(author, type, useComma) {
|
||||||
if(typeof(author) != "string") {
|
if(typeof(author) != "string") {
|
||||||
throw "cleanAuthor: author must be a 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);
|
var firstName = author.substring(0, spaceIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(firstName && firstName.toUpperCase() == firstName &&
|
if(firstName && Zotero.Utilities._allCapsRe.test(firstName) &&
|
||||||
firstName.length <= 4 && lastName.toUpperCase() != lastName) {
|
firstName.length <= 4 && lastName.toUpperCase() != lastName) {
|
||||||
// first name is probably initials
|
// first name is probably initials
|
||||||
var newFirstName = "";
|
var newFirstName = "";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user