// Remove the abstract element. It is a non visible element.
$text = self::stripAbstract($text);
- // Move all spaces out of the tags
- $text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $text);
- $text = preg_replace("/(\s*)\[\/(\w*)\]/ism", '[/$2]$1', $text);
+ // Move new lines outside of tags
+ $text = preg_replace("#\[(\w*)](\n*)#ism", '$2[$1]', $text);
+ $text = preg_replace("#(\n*)\[/(\w*)]#ism", '[/$2]$1', $text);
// Extract the private images which use data urls since preg has issues with
// large data sizes. Stash them away while we do bbcode conversion, and then put them back
'bug-7808-code-amp' => [
'expectedHtml' => '<code>&</code>',
'text' => '[code]&[/code]',
- ]
+ ],
+ 'task-8800-pre-spaces-notag' => [
+ 'expectedHtml' => '[test] Space',
+ 'text' => '[test] Space',
+ ],
];
}