diff --git a/src/Compiler/Template.php b/src/Compiler/Template.php index efc52162b..5c907d36e 100644 --- a/src/Compiler/Template.php +++ b/src/Compiler/Template.php @@ -571,6 +571,7 @@ public function processText($text) { '#(:SMARTY@!@|>)[\040\011]*[\n]\s*(?=@!@SMARTY:|<)#s' => '\1\2', // remove multiple spaces between attributes (but not in attribute values!) '#(([a-z0-9]\s*=\s*("[^"]*?")|(\'[^\']*?\'))|<[a-z0-9_]+)\s+([a-z/>])#is' => '\1 \5', + '#"[\t\s]*\n+[\t\s]*([a-z-]+=")#is' => '" \1', '#>[\040\011]+$#Ss' => '> ', '#>[\040\011]*[\n]\s*$#Ss' => '>', $this->stripRegEx => '', diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php index 35b2eaacb..3924521f9 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php @@ -61,6 +61,8 @@ public function dataTestStrip() '', '', $i ++), array("\n foo\n bar\n", " foobar", '', $i ++), + array("link-text", 'link-text', '', $i ++), + array("text", 'text', '', $i ++), // variable in html tag array("\n c\n", 'c', '', $i ++), array("\n c\n", ' c', '', $i ++),