Source for file outputfilter.trimwhitespace.php
Documentation is available at outputfilter.trimwhitespace.php
* Smarty trimwhitespace outputfilter plugin
* File: outputfilter.trimwhitespace.php<br>
* Name: trimwhitespace<br>
* Purpose: trim leading white space and blank lines from
* template source after it gets interpreted, cleaning
* up code and saving bandwidth. Does not affect
* <<PRE>></PRE> and <SCRIPT></SCRIPT> blocks.<br>
* Install: Drop into the plugin directory, call
* <code>$smarty->load_filter('output','trimwhitespace');</code>
// Pull out the script blocks
$_script_blocks = $match[0];
'@@@SMARTY:TRIM:SCRIPT@@@', $source);
// Pull out the pre blocks
$_pre_blocks = $match[0];
'@@@SMARTY:TRIM:PRE@@@', $source);
// Pull out the textarea blocks
$_textarea_blocks = $match[0];
'@@@SMARTY:TRIM:TEXTAREA@@@', $source);
// remove all leading spaces, tabs and carriage returns NOT
// preceeded by a php close tag.
// replace textarea blocks
for ($_i= 0, $_count= count($replace); $_i< $_count; $_i++ )
if (($_pos= strpos($subject, $search_str, $_pos))!== false)
|