1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-07 13:46:42 +02:00

feat(shortcodes): upd logic for tr shortcode

This commit is contained in:
Awilum
2022-05-25 20:22:49 +03:00
parent 6a26599399
commit 96a990812d

View File

@@ -33,10 +33,10 @@ parsers()->shortcodes()->addHandler('tr', static function (ShortcodeInterface $s
if ($s->getBbCode() != null) {
// Get vars
foreach($s->getParameters() as $key => $value) {
$vars = $value !== null ? strings($value)->contains($varsDelimeter) ? explode($varsDelimeter, $value) : [$value] : [];
}
$value = $s->getBbCode();
$vars = $value !== null ? strings($value)->contains($varsDelimeter) ? explode($varsDelimeter, $value) : [$value] : [];
// Parse shortcodes for each var.
$vars = array_map(fn($v) => parsers()->shortcodes()->parse(is_string($v) ? $v : ''), $vars);