Re: [SMARTY-DEV] strip problem again
| From: | messju mohr | Date: | Tue, 02 Sep 2003 08:28:14 +0000 |
| Subject: | Re: [SMARTY-DEV] strip problem again | ||
| References: | 1 2 3 4 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-1839@lists.php.net to get a copy of this message | ||
On Tue, Sep 02, 2003 at 11:58:34AM +0400, Konstantin wrote:
> > i committed an additionoal fix for strip. the extra
> > linefeeds after "?>" are now only emitted out of
> > {strip}...{/strip} context. this should make monte's
> > patch from the thread
> >
> > http://lists.php.net/article.php?group=php.smarty.dev&art
> >icle=1218 obsolete and also should fix the issues that
> > came along with it.
>
> If I understand well, now (outside of strip) there is no
> extra newline after {include},{section},{/section}, etc.
> but there is extra newline after {$var} or custom function.
>
> before
> {if true}
> inside if
> {/if}
> after
>
> before
> {textformat}
> inside textformat
> {/textformat}
> after
>
> Output:
>
> before
> inside if
> after
>
> before
> inside textformat
>
> after
>
> It should be made consistent, I think. Or it should be
> clearly stated in the documentation.
the additional newline here is emitted by {textformat} not by the fact
that it is a custom block-function.
this:
function smarty_block_block($params, $content, &$smarty)
{
return $content;
}
before
{block}
inside block
{/block}
after
gives:
before
inside block
after
just like the {if}
but i agree, the docs could make a clear statement about this which
newlines are chomped automagically and which are not.
> > everybody: please test and break it. :)
> As you wish! :)
>
> Obviously, this doesn't work:
> {strip}
> - 1 level strip -
> {strip}
> - 2 level strip -
> {/strip}
> {/strip}
>
> I'd disallow nested strip, since it has no sense.
hmm, what would be better: throwing an error or ignorig the inner
strip(s) silently?
> Konstantin A. Pelepelin
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php