cvs: smarty /libs/plugins block.strip.php
| From: | Monte Ohrt | Date: | Sun, 20 Apr 2003 18:41:44 +0000 |
| Subject: | cvs: smarty /libs/plugins block.strip.php | ||
| Groups: | php.smarty.cvs | ||
| Request: | Send a blank email to php-smarty-cvs+get-542@lists.php.net to get a copy of this message | ||
mohrt Sun Apr 20 14:41:44 2003 EDT
Added files:
/smarty/libs/plugins block.strip.php
Log:
add strip block function file to repository
Index: smarty/libs/plugins/block.strip.php
+++ smarty/libs/plugins/block.strip.php
<?php
/**
* Smarty plugin
* @package Smarty
* @subpackage plugins
*/
/**
* Smarty textformat plugin
*
* Type: block function<br>
* Name: strip<br>
* Purpose: strip unwanted white space from text<br>
*
*/
function smarty_block_strip($params, $content, &$this)
{
/* Reformat data between 'strip' and '/strip' tags, removing spaces, tabs and
newlines. */
$_strip_search = array(
"![\t ]+$|^[\t ]+!m", // remove leading/trailing space chars
'%[\r\n]+%m'); // remove CRs and newlines
$_strip_replace = array(
'',
'');
return preg_replace($_strip_search, $_strip_replace, $content);
}
/* vim: set expandtab: */
?>