[PHPTAL] Re: PHP newline consumption
Richard Cernava
cernava at gmail.com
Thu Dec 10 18:19:50 CET 2009
Kornel Lesiński <kornel at ...> writes:
>
> On 09-12-2009 at 23:06:40 Richard Cernava <cernava at ...> wrote:
>
> > I hate to bring this back up, but this does not seem to be fixed. I'm
> > running PHPTal 1.2.2a1.
> >
> > inside function prepare() I added the preg_replace underneath $result =
> > $this->parse(); to fix it for now.
> >
> > $result = preg_replace('/\?>\r?\n/', "?>\r\n\r\n", $result);
>
> Can you send me example template that exposes the problem?
>
> I'd rather not fix it by find'n'replace, as it could change other XML
> processing instructions, markup in CDATA etc.
>
Kornel Lesiński <kornel at ...> writes:
>
> On 09-12-2009 at 23:06:40 Richard Cernava <cernava at ...> wrote:
>
> > I hate to bring this back up, but this does not seem to be fixed. I'm
> > running PHPTal 1.2.2a1.
> >
> > inside function prepare() I added the preg_replace underneath $result =
> > $this->parse(); to fix it for now.
> >
> > $result = preg_replace('/\?>\r?\n/', "?>\r\n\r\n", $result);
>
> Can you send me example template that exposes the problem?
>
> I'd rather not fix it by find'n'replace, as it could change other XML
> processing instructions, markup in CDATA etc.
>
I much agree, I don't like it either.
<html>
<body >
${variable1 | string:Line 1}
<tal:block tal:content="variable2 | string:Line 2"></tal:block>
Line 3
</body>
</html>
Renders:
Line 1 Line 2
Line 3
TAL block seems to add another line break after Line 2, but variable does not.
More information about the PHPTAL
mailing list