</td>
<td>@user@domain.tld #hashtag</td>
</tr>
+<tr>
+ <td>Additionally, [pre] blocks preserve spaces:
+ <ul>
+ <li>[pre] Spaces[/pre]</li>
+ </ul>
+ </td>
+ <td> Spaces</td>
+</tr>
<tr>
<td>[nosmile] is used to disable smilies on a post by post basis<br>
<br>
// Remove escaping tags
$text = preg_replace("/\[noparse\](.*?)\[\/noparse\]/ism", '\1', $text);
$text = preg_replace("/\[nobb\](.*?)\[\/nobb\]/ism", '\1', $text);
- $text = preg_replace("/\[pre\](.*?)\[\/pre\]/ism", '\1', $text);
+
+ // Additionally, [pre] tags preserve spaces
+ $text = preg_replace_callback("/\[pre\](.*?)\[\/pre\]/ism", function ($match) {
+ return str_replace(' ', ' ', $match[1]);
+ }, $text);
return $text;
}); // Escaped code
'expectedHtml' => '[test] Space',
'text' => '[test] Space',
],
+ 'task-8800-pre-spaces' => [
+ 'expectedHtml' => ' Spaces',
+ 'text' => '[pre] Spaces[/pre]',
+ ],
];
}