|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Magoli Smarty n00b
Joined: 23 Mar 2014 Posts: 1
|
Posted: Sun Mar 23, 2014 12:43 pm Post subject: [FIX] trimwhitespace |
|
|
In file: smarty/plugins/outputfilter.trimwhitespace.php
After:
Code: | // Unify Line-Breaks to \n
$source = preg_replace("/\015\012|\015|\012/", "\t", $source); |
Add a:
Code: | $source = preg_replace('/\t/', ' ', $source);
$source = preg_replace('/ +/', ' ', $source); |
This patch fixes tabs, and much space turning into one.
Optional change this line:
Code: | // Unify Line-Breaks to \n
$source = preg_replace("/\015\012|\015|\012/", "\t", $source); |
To:
Code: | // Output in a single line
$source = preg_replace("/\015\012|\015|\012/", "", $source); |
|
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Fri Apr 04, 2014 10:59 pm Post subject: |
|
|
Note that the function of the trimwhitespace filter is to remove unnecessary whitespaces from and between HTML markup tags which might have been added for formatting reasons in source.
It does not remove whitespaces within plain text or assigned variables. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|