Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

{mailto} XHTML 1.0 Strict invalid
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
tacker
Smarty Rookie


Joined: 12 Jan 2004
Posts: 8
Location: Germany

PostPosted: Mon Jun 28, 2004 2:52 pm    Post subject: {mailto} XHTML 1.0 Strict invalid Reply with quote

Hello,

{malto escape="JavaScript" } produces invalid XHTML 1.0 Strict as
language="" ist not a valid attribute for <script>.

Quote:
Line 99, column 56: there is no attribute "language"

...ript type="text/javascript" language="javascript">eval(unescape('%64%6f%63%75
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jun 28, 2004 3:29 pm    Post subject: Reply with quote

yeah! and it's also invalid html-2.0. i think the <script>-tag was added with html-3.0.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tacker
Smarty Rookie


Joined: 12 Jan 2004
Posts: 8
Location: Germany

PostPosted: Mon Jun 28, 2004 6:26 pm    Post subject: Reply with quote

messju wrote:
yeah! and it's also invalid html-2.0. i think the <script>-tag was added with html-3.0.


You're so funny. Rolling Eyes
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Tue Jun 29, 2004 7:19 am    Post subject: Reply with quote

what makes you claim this is a bug?
what makes you claim {mailto} should produce xhtml-1.0-strict?
Back to top
View user's profile Send private message Send e-mail Visit poster's website
tacker
Smarty Rookie


Joined: 12 Jan 2004
Posts: 8
Location: Germany

PostPosted: Tue Jun 29, 2004 7:42 am    Post subject: Reply with quote

Well, IMHO webdevelopers should be encouraged to stick
to the W3C standards.

And second, as I'm using smarty a lot I was just courious
about this thing and thought it must be a mistake as smarty
always worked for me like a charm.

You could've just statet that "we don't support x but only y".
Giving harshly answers makes me frown.

Finally, I am willing to contribute to have smarty produce
W3C standards conform code.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Jun 29, 2004 8:51 am    Post subject: Reply with quote

tacker wrote:
Finally, I am willing to contribute to have smarty produce
W3C standards conform code.


I think the point might be that Smarty is producing W3C standards conformant code (since HTML3/4 are W3C standards)--it is just not xhtml-1.0-strict conformant. The reason is likely pragmatic: the vast majority of browsers out there aren't xhtml-1.0-strict conformant.

Its a bit of a conundrum, I think.
Back to top
View user's profile Send private message
tacker
Smarty Rookie


Joined: 12 Jan 2004
Posts: 8
Location: Germany

PostPosted: Tue Jun 29, 2004 9:01 am    Post subject: Reply with quote

Yeah, I know that.
I just fancy with an attribute in the class wich sets the desired
output standard. Every plugin could read that attribute and
adapt its output accordingly.

Even if most browsers aren't fully featured that's not a reason for
me not to stickt to these standards.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Jun 29, 2004 9:15 am    Post subject: Reply with quote

tacker wrote:
I just fancy with an attribute in the class wich sets the desired output standard. Every plugin could read that attribute and
adapt its output accordingly.


So you end-up implementing dozens of standard switch cases in each plugin? -1 on that. I think a generalized and efficient solution is not that simple. [for example, another solution is to have each plugin define values that get passed to specialized templates that actually do the output generation, if you follow me. That way, the plugin only does "calculation work" and each standard's formatting for that plugin is contained in a separate "template"]

Quote:
Even if most browsers aren't fully featured that's not a reason for
me not to stickt to these standards.


Yes it is, particularly when older standards already suffice and are better supported. You are aware, for example, that IE has about 90% market share? I think some standards are best left alone. When a standard changes a feature that is implemented in nearly 100% of browsers to a feature that is implemented in less than 10% of browsers (and those 10% of browsers already support the old method) than as a developer, you are best not changing to the new standard. In fact, you are wasting your time. In my mind, the standards makers are wasting time, too, because they are only re-implementing something that already works and works well, thank-you.

In my opinion, standards should prove themselves useful (and thus be widely implemented) before designers bother deploying them. When a standard is supplanting a previous standard, its burden is even greater. Let's be practical, the "correct" thing is not following the latest (and most fashionable) standards--but rather it is reaching the widest audience.

Right now HTML4 is the standard on the net. Perhaps that will change in the future (who knows, maybe Firefox will one day rule the roost or perhaps one day MS will release a better IE) but until then, I'd rather that Smarty supported the widest range of browsers. If you need specialized output, why not just roll your own plugins--maybe even a family of plugins and post them at the wiki.

--

To be fair to your point (and FWIW) I think it is "bad" to hard-boil text into the plugin and that is where the crux of this discussion should probably lead to. The current plugin system is somewhat lacking in the face of the need to support multiple standards (which appears to be an emerging, but still periphary trend). It was fine when we only cared about HTML4 and weren't concerned about hard-coding emitted text--but I think we are starting to get to the point where that will prove to be too simplistic a model.
Back to top
View user's profile Send private message
tacker
Smarty Rookie


Joined: 12 Jan 2004
Posts: 8
Location: Germany

PostPosted: Tue Jun 29, 2004 10:26 am    Post subject: Reply with quote

Thanks for the answer.
I can understand your arguments.
I'd like to see the idea of per-standard templates in plugins
coming alive.
Creating my own set of XHTML-strict compliant plugins
seems a bit of an overhead to me as this creates redundant
code.
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger
c960657
Smarty Regular


Joined: 07 May 2003
Posts: 75
Location: Copenhagen, Denmark

PostPosted: Tue Jun 29, 2004 2:18 pm    Post subject: Reply with quote

If the language attribute is omitted, the output of {mailto encode="javascript"} will be both valid HTML 4 and XHTML 1 without any special casing in the plugin code.

Do you know of any browser that supports Javascript but does not treat a <script> element without a language attribute as Javascript?
Back to top
View user's profile Send private message Visit poster's website
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Tue Jun 29, 2004 2:44 pm    Post subject: Reply with quote

yeah, that should work for pretty much all HTML4+ browsers. In retrospect (and now that I've had a coffee), adding type= and dropping language= should be relatively safe in that regard.

On-the-other-hand, the idea that Smarty SHOULD fully support xhtml-1.0-strict is still suspect to me, but if doing so doesn't cause any harm, then what-the-heck.
Back to top
View user's profile Send private message
tk
Smarty Regular


Joined: 31 Oct 2003
Posts: 49
Location: London, UK

PostPosted: Tue Jun 29, 2004 4:07 pm    Post subject: Reply with quote

Yup.. <script type="text/javascript"> is what's I use in my XHTML1.1 sites.. validates just fine, and works in "all" browsers it should do.. and works in that app called IE too ;P

Whether this conforms to HTML standards I'm not sure.. not written a non-XHTML site in a long time.

I think Smarty should use XHTML strict / 1.1 but much depends on what you use. My Smarty XHTML1.1 sites validate 100% according to W3C.. so I wouldn't say there's that much of an issue.. personally I don't use the Javascript encoding for anything.. and for one reason.. this is client optional, if disabled (like I normally browse) then things don't work quite like you intended.. the hex encoding works great.. I don't think I've had any of the few addresses I've used with it harvested at all =)



Regards,

tk
_________________
Certified Code Junkie(tM)
Copyleft (L) two thousand and now, tk
Back to top
View user's profile Send private message Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Tue Jun 29, 2004 5:08 pm    Post subject: Reply with quote

The unnecessary and non-conformant language="javascript" attribute has been removed from the mailto function in CVS. May your validators jump with glee.
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Fri Jul 02, 2004 8:53 am    Post subject: Reply with quote

mohrt wrote:
The unnecessary and non-conformant language="javascript" attribute has been removed from the mailto function in CVS.


really? i can't find that change.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Fri Jul 02, 2004 2:17 pm    Post subject: Reply with quote

It should be there now, my last commit didn't succeed.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP