From e9016bc0149967fc4e794044918be31ed0212a6c Mon Sep 17 00:00:00 2001
From: coderkun
Date: Fri, 1 Aug 2014 10:17:16 +0200
Subject: [PATCH] improve TextFormatter: remove whitespaces between table-tags
---
app/TextFormatter.inc | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/app/TextFormatter.inc b/app/TextFormatter.inc
index 6aef679b..a7a8a0b7 100644
--- a/app/TextFormatter.inc
+++ b/app/TextFormatter.inc
@@ -65,6 +65,10 @@
$string = str_replace('[/strong]', '', $string);
// Create tables
+ $string = preg_replace('/(\[table\])\s+/u', '$1', $string);
+ $string = preg_replace('/\s*(\[tr\])\s*/u', '$1', $string);
+ $string = preg_replace('%\s+(\[/table\])%u', '$1', $string);
+ $string = preg_replace('%\s*(\[/tr\])\s*%u', '$1', $string);
$string = str_replace('[table]', '
', $string);
$string = str_replace('[/table]', '
', $string);
$string = str_replace('[tr]', '
', $string);