Strip
| From: | Anders Janson | Date: | Tue, 11 Sep 2001 09:08:29 +0000 |
| Subject: | Strip | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-1459@lists.php.net to get a copy of this message | ||
Webmaster Flash France wrote:
> Hi, Anders,
>
> Thx for answering ....
Hi, sorry, I never meant this to be just a reply to you privately, I assumed it would also
go to the Smarty list.
It didn't :( Let's see if this reply makes it to the list...
>
>
> I think there is a misunderstanding ... i think my english is not as
> good as it is needed to explain all I want how I want ... so I ll try
> to do my best ;).
I think I understood... :-o
>
>
> I think stripping HTML data can reduce it of 50 %.... so it is an
> interesting issue....
Indeed! I add {strip} when my code is almost finished, and there is no need to read/debug
the output anymore!
>
>
> I have not tested strip in all case ... but if your code is clean and
> respect HTML 4.01 there is no way it will be destroy by stripping ...
Hmm... are you saying it's illegal HTML to have text spanning over several lines? No way!
Like this:
<P>
bla
bla
bla
</P>
This is certainly destroyed when stripped.
>
> if you make a highlight of a PHP Source you'll have a stripped HTML
> code with some "<PRE>" ....
>
> for your example with :
> AJ> <TABLE
> AJ> cellpadding=0
> AJ> cellspacing=0
> AJ> bgcolor=#000000>
>
> do u think it's HTML ??? ;;)))))
No, it's buggy XML that I use to crash the parser... just joking :)
>
>
> i mean who here wrote HTML like this ???? even Frontpage do better
> code !
Hehe, I wrote that just now. I know it's not "formally" correct, but it works in most
browsers. :-D
But even with quoted attributes, the output is ugly when stripped, and I'm not sure it
works either....
Anyway, I like to split up tags with lots of attributes like that. And it is very
frustrating to see my page render fine before it is stripped, and then start debugging,
just because {strip} does not strip properly.
>
>
> we have to respect standards ... so let s do it ;) ....
Uhmm, well... OK :)
But still, Smarty should respect my coding ;)
Crap input -> crap output.
Not "similar but different crap" output, please.
>
>
> in fact after thinkiing of it i think it could be interesting to add a
> global var to the compiler ( like for caching files ) to strip
> automatically all templates or not ....
>
> and add a {nostrip} tag to handle impossible strippping of piece of
> code when you have this variable turn to ON.
>
> What do u think of it ?
Perhaps if would be difficult to implement?
I know how it works today, I have messed around in the implementation of {strip}, and it
would have to be completely rewritten to handle a {nostrip} tag.
Personally, I don't have a need for an implicit {strip}...{/strip} applied to all
templates.
Since the template author still has to think (!) and write {nostrip} on parts he doesn't
want stripped, what have we won?
Well, maybe {nostrip} would need to be written 10 times... that would be better than
writing {strip} 100 times :)
Anyway, don't ask me :)
Ask the Smart community!
/Anders