#90 [Opn]: Whitespace Trailing Substitution Eaten

From: Date: Mon, 13 Oct 2003 02:18:08 +0000
Subject: #90 [Opn]: Whitespace Trailing Substitution Eaten
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-22624@lists.php.net to get a copy of this message
ID: 90 Updated by: alan_k@php.net Reported By: mitch at enetis dot net Status: Open Bug Type: HTML_Template_Flexy Operating System: debian linux PHP Version: 4.3.3 New Comment: It's a known oddity of the php engine - it strips CR/LF following the ?> Normally for emails, I'm tempted to recommend the regex parser - $x = new HTML_Template_Flexy(array( 'compiler'=>'Regex', 'filters' => array('SimpleTags', 'mail'), )); As it wont try and parse 'alan <alan@example.com>' as html.. = and also has the fix for CR/LF adding.. Previous Comments: ------------------------------------------------------------------------ [2003-10-12 22:04:14] mitch at enetis dot net 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 this bug report at http://pear.php.net/bugs/bug.php?id=90&edit=1

« previous php.pear.dev (#22624) next »