From e6453b2088434d7b2d49c6b357b2d4635a69bc79 Mon Sep 17 00:00:00 2001 From: Dan Stillman Date: Thu, 19 Mar 2020 10:24:03 -0400 Subject: [PATCH] Parse single tab-delimited creator And fix logged error when adding empty creator with just whitespace --- chrome/content/zotero/bindings/itembox.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/chrome/content/zotero/bindings/itembox.xml b/chrome/content/zotero/bindings/itembox.xml index 4dd094e1bd..4544938e4d 100644 --- a/chrome/content/zotero/bindings/itembox.xml +++ b/chrome/content/zotero/bindings/itembox.xml @@ -1814,7 +1814,7 @@ var tabindex = textbox.getAttribute('ztabindex'); //var value = t.value; - var value = textbox.value; + var value = textbox.value.trim(); var elem; var [field, creatorIndex, creatorField] = fieldName.split('-'); @@ -1828,9 +1828,9 @@ otherFields[creatorField] = value; var lastName = otherFields.lastName.trim(); - //Handle \n\r and \n delimited entries + //Handle \n\r and \n delimited entries and a single line containing a tab var rawNameArray = lastName.split(/\r\n?|\n/); - if (rawNameArray.length > 1) { + if (rawNameArray.length > 1 || rawNameArray[0].includes('\t')) { //Save tab direction and add creator flags since they are reset in the //process of adding multiple authors var tabDirectionBuffer = this._tabDirection;