Re: [SMARTY-DEV] strip problem again
| From: | messju mohr | Date: | Tue, 02 Sep 2003 10:20:41 +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-1841@lists.php.net to get a copy of this message | ||
On Tue, Sep 02, 2003 at 01:14:26PM +0400, Konstantin wrote:
> > > 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.
> > > 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.
> Yes, you're right with block functions, I'm sorry.
> But {include} should work the same as custom function, for
> example, {mailto}. From designer's point of view {include}
> is the same as any other custom function. Currently they
> work differently. I suppose to add newline after {include}.
> And I have not tested {include_php} and {insert}, but they
> should work like {include}. Or alternatively remove extra
> newline from custom functions.
>
>
> This example.
>
> Include:
> {include file='test.html'}
> Var:
> {"text"}
> Mailto:
> {mailto address="me@domain.com"}
> Assign:
> {assign var='var' value='val'}
> After.
AFAIR {insert} does add a newline but {include} and {include_php} not
yet.
> > > 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?
> Ignoring, if it's simple to implement.
thats simple.
additionally: throwing errors for incorrectly nested {strip}s would
be just a few lines more code and also not complicated.
i mean:
{strip}
bar
{strip}
foo
{/strip}
{/strip}
should ignore the inner strip and lead to:
barfoo
but
{strip}foo{/strip}{/strip}
or
{strip}foo{strip}{/strip}
should throw syntax errors.
the only concern i have with introducing error-conditions here is
backwards-compatibility. but these errors are thrown on templates that
where already buggy in the first place, so it is an option for me.
> Konstantin A. Pelepelin
>
> --
> Smarty Development Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php