lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: lynx-dev A Missing >...


From: Klaus Weide
Subject: Re: lynx-dev A Missing >...
Date: Wed, 2 Aug 2000 15:20:36 -0500 (CDT)

On Mon, 24 Jul 2000, pAb-032871 wrote:
> Thomas Dickey wrote:
> 
> > On Wed, Jul 19, 2000 at 02:45:10PM -0500, Klaus Weide wrote:
> > > If the '>' is completely missing from the '</SCRIPT>' tag, some stuff
> > > after the defective tag will just be junked - until the next '>';
> > > this isn't different from missing '>' in other situations.
> 
> If someone forgets to put a ">" after their tag, it'll screw ay
> browser up, and they're likely to fix it as soon as they find
> out about it.

Indeed.  Unless the next '>' in the input stream happens very soon,
at which point the unclosed tag will get closed, and whatever got
junked in between was "nothing important" (say, just a </HEAD> tag
that has no direct impact in most browsers anyway).

> > > 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


> > > looking for a '</SCRIPT' in that case.
> > 
> > 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.

> Unless this is what you meant by "quoted".

I meant the backslash.

> 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?

> reading the closing ">" as the end of the comment.


  Klaus


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]