From 5f4d2a3bb5f2f8cd4ecc151f02538f4f41312522 Mon Sep 17 00:00:00 2001 From: Moon Man Date: Sat, 2 Apr 2016 14:32:03 -0700 Subject: [PATCH] grab whitespace before and after br tag --- GSGreenTextPlugin.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GSGreenTextPlugin.php b/GSGreenTextPlugin.php index 6ebd8eb..5ac2745 100644 --- a/GSGreenTextPlugin.php +++ b/GSGreenTextPlugin.php @@ -8,6 +8,8 @@ class GSGreenTextPlugin extends Plugin { const VERSION = '0.0.1'; + const LINE_SEP = "/\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("/\r?\n*/", $notice->rendered, -1); + $sepnotice = preg_split(self::LINE_SEP, $notice->rendered, -1); foreach($sepnotice as &$sep) {