diff --git a/src/Builder.php b/src/Builder.php index fa1f0cb..4a61c60 100644 --- a/src/Builder.php +++ b/src/Builder.php @@ -68,7 +68,7 @@ class Builder return vsprintf("", [ $key, - htmlentities($value), + htmlentities($this->implode($value)), ]); } @@ -77,6 +77,14 @@ class Builder */ private function implode($value, $separator = '|') { + if (is_string($value)) { + return $value; + } + + if (is_array($value) && count($value) === 1) { + return reset($value); + } + return sprintf('(%s)', collect($value)->implode($separator)); } }