#90 [NEW]: Whitespace Trailing Substitution Eaten
| From: | mitch at enetis dot net | Date: | Mon, 13 Oct 2003 02:04:14 +0000 |
| Subject: | #90 [NEW]: Whitespace Trailing Substitution Eaten | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-22623@lists.php.net to get a copy of this message | ||
From: mitch at enetis dot net
Operating system: debian linux
PHP version: 4.3.3
PHP Bug Type: HTML_Template_Flexy
Bug description: Whitespace Trailing Substitution Eaten
Description:
------------
Newlines following a {variable} disappear after substitution.
This is not a big deal when generating HTML, obviously, but one sees it
if one is using a template to make plain text, such as for an email.
Use the following two lines for template.text in the reproduce code:
W{foo}
{bar}Z
Later,
- Mitch
Reproduce code:
---------------
<?
require_once 'HTML/Template/Flexy.php';
$obj = new StdClass;
$obj->foo = 'X';
$obj->bar = 'Y';
$options = array('templateDir' => '.',
'compileDir' => '.',
'compiler' => 'Standard');
$output = new HTML_Template_Flexy($options);
$output->compile('template.text');
$output->outputObject($obj);
?>
Expected result:
----------------
WX
YZ
Actual result:
--------------
WXYZ
--
Edit bug report at http://pear.php.net/bugs/bug.php?id=90&edit=1
--