Trim string to avoid leading whitespace if label is empty

This commit is contained in:
Marcus Moore 2024-04-11 16:38:22 -07:00
parent 81b8c111ca
commit 2b137d76fa
No known key found for this signature in database

View file

@ -155,10 +155,10 @@ class Label implements View
// The end result of this will be in this format:
// {labelOne} {valueOne} | {labelTwo} {valueTwo} | {labelThree} {valueThree}
$carry['value'] = implode(' | ', [
$carry['value'] = trim(implode(' | ', [
implode(' ', [$carry['label'], $carry['value']]),
implode(' ', [$item['label'], $item['value']]),
]);
]));
// We'll set the label to an empty string since we
// injected the label into the value field above.