[whatwg] <% text %> and <? text ?> in corporate intranet html content

Biju bijumaillist at gmail.com
Thu Feb 11 00:07:56 PST 2010


On Wed, Feb 10, 2010 at 2:25 AM, Boris Zbarsky <bzbarsky at mit.edu> wrote:
> Well, for a start the "IE way" would need to be defined.  I haven't quite
> seen anyone do that yet.
Safari and Chrome display content in "IE way", but they dont follow
"IE way" for DOM

IE Way:-
May need to check with Microsoft, but this is what I see
If you see  <% some text %> treat it like a HTML comment.
Also a comment node will be created in DOM,
and when its parent nodes .innerHTML is displayed the original content
will be shown with out altering.
the text inside <% and %> may contain any number of percentage sign or
greater than sign,
as long as they dont make a "%>" pair.

If you see  <? some text > treat it like a HTML comment.
Again for this also a comment node will be created  in DOM,
and when its parent nodes .innerHTML is displayed the original content
will be shown with out altering.
the text inside <? and > may contain any number of question mark or
greater than sign,
as long as greater than sign is enclosed in single quote or double quote.

ie,
   <? echo ">>>> ?>"   '?>'  some more text ?>
is OK, but NOT
   <? if (a > b) echo ">" ?>
it will be displayed as :-
 b) echo ">" ?>

I agree that allowing  "?>"  part is weird, they should have done it
same way as "<% text %>"


On Wed, Feb 10, 2010 at 10:40 PM, Ian Hickson <ian at hixie.ch> wrote:
>> At least in one page I saw, which was Case 1 and page was originally
>> from a JSP or ASP template later modified and saved as a *.html
>
> I recommend fixing the page. :-)

Hey, this is corporate intranet page, there is no way to fix it unless
you show them broken in IE6
it would have been remotely possible if Safari and Chrome also followed Firefox

>> So will IE and Safari (may be chrome also, i have not tested it) follow
>> Firefox way?
>
> Hard to say. You'd have to ask Microsoft.

What about Apple and Google, as at least Safari/Chrome/Webkit
developers are active participant on this list.

Thanks
Biju



More information about the whatwg mailing list