From 15f58173c8460664f9613636b4e94b835607d7aa Mon Sep 17 00:00:00 2001 From: Makis Tracend Date: Thu, 14 Nov 2013 03:11:35 -0800 Subject: [PATCH] excluding textarea(s) from trimming whitespace --- app/helpers/template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/template.php b/app/helpers/template.php index 9eb76a6..389e501 100644 --- a/app/helpers/template.php +++ b/app/helpers/template.php @@ -332,8 +332,8 @@ function updateDom($tag, $dom){ } function trimWhitespace( $string ){ - // replace multiple spaces with one - return preg_replace( '/\s+/', ' ', $string ); + // replace multiple spaces with one (except textarea) + return preg_replace( '/(?:\s+(?![^<]*<\/textarea>))/', ' ', $string ); } }