From 988bb6b7a8c1fa260c96154b9b0b19e0384b937a Mon Sep 17 00:00:00 2001 From: Andy Arenson Date: Wed, 23 Oct 2019 15:01:55 -0400 Subject: [PATCH] Allow indeterminate amount of whitespace when detecting choices --- TableauConnector.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TableauConnector.php b/TableauConnector.php index 4036da5..4a68e45 100644 --- a/TableauConnector.php +++ b/TableauConnector.php @@ -375,7 +375,7 @@ function getCheckboxChoiceLabel($response, rcExportVarname) { var choiceOptionString = $response.find( 'CodeList[OID="'+rcExportVarname+'.choices"]' ).attr('redcap:CheckboxChoices'); var choiceVarVal = rcExportVarname.split('___'); var choiceLabel = choiceVarVal; - choiceOptionString.split(' | ').forEach(function(c) { + choiceOptionString.split(/\s*\|\s*/g).forEach(function(c) { if (c.lastIndexOf(choiceVarVal[1]+', ', 0)===0) { // if (c.startsWith(choiceVarVal[1]+', ')) { // do not use startsWith() ! choiceLabel = c.replace(choiceVarVal[1]+', ', ''); }