Bug 24980 - Webkit donot support short comment tag, but gecko, trident support
Summary: Webkit donot support short comment tag, but gecko, trident support
Status: RESOLVED CONFIGURATION CHANGED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Windows XP
: P2 Normal
Assignee: Chris Dumez
URL: https://github.com/diyism/jquery_micr...
Keywords:
Depends on:
Blocks:
 
Reported: 2009-03-31 21:45 PDT by diyism
Modified: 2022-12-22 18:14 PST (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description diyism 2009-03-31 21:45:06 PDT
Webkit does not support short comment tag, but gecko, trident support it,
maybe this is not a bug, but it's more important than a bug in the web 2.0 world,
we jquery guys are building a browser side template engine with javascript as below, in firefox or ie, we can use short comment tag "<!" as template starting tag, but in safari or chrome we can only use long comment tag "<!--", so it's annoying:

<div id="test1" class="users"><br>
     <!for (i=0;i<users.length;++i){!>
     Name:<a href="<!=users[i].name!>"><!=users[i].name!></a><br>
     <!}!>
</div>
<script>
var data={users:[{name:'name1'},
                 {name:'name2'}
                ]
         };
$('#test1').drink(data);
</script>

javascript template rending engine is at this place:
http://plugins.jquery.com/project/micro_template
Comment 1 Ahmad Saleem 2022-08-09 14:45:39 PDT
As per WHATWG standard, only <!-- --> is allowed:

https://html.spec.whatwg.org/multipage/syntax.html#comments

I am marking this as "RESOLVED WONTFIX", if I am incorrect or linked to incorrect Web-Spec, please ignore my comment and reopen this. Thanks!
Comment 2 Alexey Proskuryakov 2022-08-18 17:08:36 PDT
This works in WebKit now. 

This HTML5 link above is contains author requirements, it says that documents must be using <!-- as comments. But browser behavior is a lot more complicated, and <! actually works. One would have to follow the algorithm in https://html.spec.whatwg.org/multipage/parsing.html#tokenization to see it standardized.
Comment 3 diyism 2022-08-24 07:55:29 PDT
Great, I can confirm jquery_micro_template(https://github.com/diyism/jquery_micro_template) works on google chrome 100+
Comment 4 Chris Dumez 2022-12-22 14:01:23 PST
Re-opening for pull request https://github.com/WebKit/WebKit/pull/8021
Comment 5 Ahmad Saleem 2022-12-22 18:14:55 PST
(In reply to Chris Dumez from comment #4)
> Re-opening for pull request https://github.com/WebKit/WebKit/pull/8021

I think this was reopened by mistake since the PR refers to bug 249808.

Closing this again.