fix: drop blank lines and split on any line break in nl2list
This commit is contained in:
1 parent
9ba6529ee0
commit
eda7856e48
2 files changed
+40
-1
No files matched your search
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user