Skip to content

Commit

Permalink
- bugfix {strip} remove space on linebreak between html tags #213
Browse files Browse the repository at this point in the history
  • Loading branch information
uwetews committed Apr 28, 2016
1 parent 116854c commit 2cb0351
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
3 changes: 3 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
 ===== 3.1.30-dev ===== (xx.xx.xx)
29.04.2016
- bugfix {strip} remove space on linebreak between html tags https://github.com/smarty-php/smarty/issues/213

24.04.2016
- bugfix nested {include} with relative file path could fail when called in {block} ... {/block} https://github.com/smarty-php/smarty/issues/218

Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.30-dev/63';
const SMARTY_VERSION = '3.1.30-dev/64';

/**
* define variable scopes
Expand Down
7 changes: 4 additions & 3 deletions libs/sysplugins/smarty_internal_templatecompilerbase.php
Original file line number Diff line number Diff line change
Expand Up @@ -818,9 +818,10 @@ public function processText($text)
}
}
$expressions = array(// replace multiple spaces between tags by a single space
// can't remove them entirely, becaue that might break poorly implemented CSS display:inline-block elements
'#(:SMARTY@!@|>)\s+(?=@!@SMARTY:|<)#s' => '\1 \2',
// remove spaces between attributes (but not in attribute values!)
'#(:SMARTY@!@|>)[\040\011]+(?=@!@SMARTY:|<)#s' => '\1 \2',
// remove newline between tags
'#(: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',
'#>[\040\011]+$#Ss' => '> ', '#>[\040\011]*[\n]\s*$#Ss' => '>',
$this->stripRegEx => '',);
Expand Down

0 comments on commit 2cb0351

Please sign in to comment.