From 3756588858acfe0f3f64c2fd47f5ff3a58728592 Mon Sep 17 00:00:00 2001 From: uwetews Date: Thu, 11 Feb 2016 22:05:45 +0100 Subject: [PATCH] - improvement added KnockoutJS comments to trimwhitespace outputfilter https://github.com/smarty-php/smarty/issues/82 https://github.com/smarty-php/smarty/pull/181 --- change_log.txt | 4 ++++ libs/plugins/outputfilter.trimwhitespace.php | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/change_log.txt b/change_log.txt index 95a5b4ff..e65b5830 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,8 @@  ===== 3.1.30-dev ===== (xx.xx.xx) + 11.02.2016 + - improvement added KnockoutJS comments to trimwhitespace outputfilter https://github.com/smarty-php/smarty/issues/82 + https://github.com/smarty-php/smarty/pull/181 + 10.02.2016 - bugfix {strip} must keep space on output creating smarty tags within html tags https://github.com/smarty-php/smarty/issues/177 - bugfix wrong precedence on special if conditions like '$foo is ... by $bar' could cause wrong code https://github.com/smarty-php/smarty/issues/178 diff --git a/libs/plugins/outputfilter.trimwhitespace.php b/libs/plugins/outputfilter.trimwhitespace.php index 79b48528..1a67123a 100644 --- a/libs/plugins/outputfilter.trimwhitespace.php +++ b/libs/plugins/outputfilter.trimwhitespace.php @@ -26,8 +26,8 @@ function smarty_outputfilter_trimwhitespace($source) // Unify Line-Breaks to \n $source = preg_replace("/\015\012|\015|\012/", "\n", $source); - // capture Internet Explorer Conditional Comments - if (preg_match_all('##is', $source, $matches, + // capture Internet Explorer and KnockoutJS Conditional Comments + if (preg_match_all('##is', $source, $matches, PREG_OFFSET_CAPTURE | PREG_SET_ORDER)) { foreach ($matches as $match) { $store[] = $match[ 0 ][ 0 ];