diff --git a/src/Twig/AppRuntime.php b/src/Twig/AppRuntime.php index 203e71d..7cfad54 100644 --- a/src/Twig/AppRuntime.php +++ b/src/Twig/AppRuntime.php @@ -214,7 +214,8 @@ class AppRuntime implements RuntimeExtensionInterface return ''; } - $items = explode(PHP_EOL, $content); + // any line break, as textareas submit \r\n; blank lines (the default benefits end with one) are no items + $items = array_filter(array_map('trim', preg_split('/\R/', $content)), fn (string $item) => '' !== $item); $list = '