grab whitespace before and after br tag

This commit is contained in:
Moon Man 2016-04-02 14:32:03 -07:00
parent 431363fedd
commit 5f4d2a3bb5
1 changed files with 3 additions and 1 deletions

View File

@ -8,6 +8,8 @@ class GSGreenTextPlugin extends Plugin
{
const VERSION = '0.0.1';
const LINE_SEP = "/\s*<br\s*?\/?>\s*/";
public function onEndShowStyles(Action $action)
{
$action->style(".greentext { color: green; }");
@ -20,7 +22,7 @@ class GSGreenTextPlugin extends Plugin
function onStartNoticeSave(&$notice)
{
$sepnotice = preg_split("/<br\s*?\/?>\r?\n*/", $notice->rendered, -1);
$sepnotice = preg_split(self::LINE_SEP, $notice->rendered, -1);
foreach($sepnotice as &$sep)
{