fix: drop blank lines and split on any line break in nl2list

This commit is contained in:
fromme committed 2026-11-12 11:25:30 +01:00
1 parent 9ba6529ee0
commit eda7856e48
2 files changed
+40 -1

No files matched your search

+2 -1
View File
@@ -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 = '<ul class="'.$class.'">';
foreach ($items as $item) {