[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: lynx-dev A Missing >...
From: |
Patrick |
Subject: |
Re: lynx-dev A Missing >... |
Date: |
Wed, 2 Aug 2000 16:30:25 -0700 |
In "Re: lynx-dev A Missing >..."
[02/Aug/2000 Wed 13:20:36]
Klaus Weide wrote:
> On Mon, 24 Jul 2000, pAb-032871 wrote:
> > Thomas Dickey wrote:
[...]
> > > > I don't think this is the best way. It may also prematurely end the
> > > > SCRIPT contents on '</SOMETHING' that isn't '</SCRIPT', and while that's
> > > > not valid input (any '</SOMETHING' in the script content should have
> > > > been
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > > > written with some form of escaping), it is probably more useful to
> > > > continue
> > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Not neccesarily. See below.
>
> The HTML 4.01 Specification disagrees with you:
>
> Linkname: Performance, Implementation, and Design Notes
> URL: http://www.w3.org/TR/html4/appendix/notes.html#h-B.3.2.1
Ah, sorry. I refer to the specs pretty often, but haven't read the
whole thing[s]. . . You see a lot of "temporary delete" comments,
containing markup and </TAGS>, presumably where people *think* they
want something out of their HTML but haven't quite decided yet.
> > > shouldn't the tag end when it sees a new "<", unless it's quoted?
> >
> > This would cause some problems if there was some kind of
> > if(whatever){
> > document.write("<B>bold text</B>")
> > }
> > content in the script itself. . .
>
> And indeed that's invalid. If the language is something like Javascript,
> it can be written as
> document.write("<B>bold text<\/B>")
> or
> document.write("<B>bold text<" + "/B>")
> instead.
Thanks. As above, I see enough invalid HTML that it looks normal
to me [umm, invalid *scripting* this time].
> > Unless this is what you meant by "quoted".
>
> I meant the backslash.
Taken from the other message:
> > I meant the backslash.
>
> Sorry, forget THAT remark... It was Tom who wrote "unless it's quoted"
> (as quoted above :) ), and he explained later what he meant.
>
> Klaus
It was still a good point. Not the *same* point, but still a good
one. Thanks.
> > Also, it's generally recomended that anything between <SCRIPT>
> > tags be commented-out so browsers that don't support scripting
> > won't try to display a bunch of JavaScript gibberish in source
> > form. That doesn't guarantee it's going to happen, but most of
> > the HTML source I've seen has been pretty good about it.
> >
> > A very simple example:
> >
> > <SCRIPT LANGUAGE="JavaScript1.1">
> > <!-- Begin hiding from non-scriptable browsers
> > document.write("some HTML\, including <TAGS> and")
> > document.write("<TAG ATTRIBUTE=\"value\">")
> > // End -->
> > </SCRIPT>
> >
> > These sorts of <!-- comments --> are allowed within scripts, because
> > JavaScript recognizes them as commenting-out *only one line*.
> > The "//" comment is needed at the end, however.
> >
> > It's a valid comment in HTML,
>
> No, it isn't parsed as a comment in HTML. It's CDATA. CDATA isn't
> parsed for SGML comment declarations.
>
> This is only for browsers that don't understand that SCRIPT (and
> STYLE) content has to be parsed differently from other elements.
> It isn't necessary for lynx (of any recent version).
>
> > except that some browsers might
> > begin rendering everything after "some HTML\, including <TAGS>"
> > [including Lynx if its HTML-parsing options are set to do that],
>
> I doubt it. Have you tried it?
I was talking about a comment-parsing option from lynx.cfg:
# If HISTORICAL_COMMENTS is TRUE, Lynx will revert to the "Historical"
# behavior of treating any '>' as a terminator for comments, instead of
# seeking a valid '-->'
[...]
but I didn't know Lynx treats things differently within <SCRIPT>
tags. You're right. This:
<TITLE>comment test</TITLE>
<!-- this shouldn't appear HTML >
this shouldn't appear either HTML -->
<P> end test 1<P>
<SCRIPT>
<!--
this shouldn't appear JS >
nor should this JS
-->
</SCRIPT>
<P>just checking ...
Was rendered as this, even with HISTORICAL_COMMENTS set TRUE:
this shouldn't appear either HTML -->
end test 1
just checking ...
"nor should this JS" was nowhere to be seen. :-)
Patrick
<mailto:address@hidden>
; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden