View previous topic :: View next topic |
Author |
Message |
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Tue Aug 26, 2003 2:40 pm Post subject: Latest CVS: {strip} doesn't fully strip |
|
|
Code: | {capture name="test"}{strip}
{if $foo == "bar"}
blah
{else}
blub
{/if}
{/strip}{/capture}
"{$smarty.capture.test}" |
The above example will output " blub ". Notice the space at the beginning and at the end of the string. It seems this happens since you moved back {strip} into the compiler. |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Tue Aug 26, 2003 4:32 pm Post subject: |
|
|
i cannot reproduce this. neither with cvs nor with 2.6.0-RC1. |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Tue Aug 26, 2003 5:02 pm Post subject: |
|
|
hmm. Using andre's example, I reproduce the exact same output that he does with the current cvs. I didn't test 2.6.0RC1, but interestingly, 2.5.0 shows the exact same behaviour. |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Aug 27, 2003 5:51 am Post subject: |
|
|
?!? Hmm... I'll test again |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Wed Aug 27, 2003 5:53 am Post subject: |
|
|
I may have said that in a confusing way--I reproduced andre's claim |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Aug 27, 2003 6:18 am Post subject: |
|
|
Bingo: Using Lastest CVS...
After the first {strip} you should add a space so the line looks
'{capture name="test"}{strip} '
This space won't be stripped.
Then add a space behind "blub" or "{/if}" and it won't be filtered too.
My test code looks like the following:
Code: | $template = new Smarty();
$template->display("test.tpl"); |
BTW: messju, what are you doing at 5:30 a.m.?!?! Don't you need a bit of sleep |
|
Back to top |
|
messju Administrator
Joined: 16 Apr 2003 Posts: 3336 Location: Oldenburg, Germany
|
Posted: Wed Aug 27, 2003 8:58 am Post subject: |
|
|
okay, this is fixed in cvs now. please test if i didn't break anything else around {strip}.
@André: 5:30 ? normally i sleep at this time-of-day. maybe you got fooled by the timezones phpBB displays?? |
|
Back to top |
|
andre Smarty Pro
Joined: 23 Apr 2003 Posts: 164 Location: Karlsruhe, Germany
|
Posted: Wed Aug 27, 2003 9:15 am Post subject: |
|
|
Looks good now... thanks
I'll report if I find something unusual.
@messju: Oops timezones, yes... +1 hour But 6:30 is early enough ... |
|
Back to top |
|
|