lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev bug in comments process


From: Klaus Weide
Subject: Re: lynx-dev bug in comments process
Date: Sat, 31 Jul 1999 11:03:37 -0500 (CDT)

On Sat, 31 Jul 1999, Vlad Harchev wrote:

> On Fri, 30 Jul 1999, Klaus Weide wrote:
> 
> > > >   http://www.brunching.com/features/feature-disneywarnings.html
> > 
> > By the way, this is apparently parsed differently with -prettysrc,
> > not consistent with normal parsing.  Vlad, how did you manage that?
> > Can you correct it?
> 
> 
>  I inspected the problem. It seem to me this is due to the fact that <script>
> has SGML_LITTERAL content - so even normal html comments are not recognised in
> it. 

THEY ARE NOT NORMAL HTML COMMENTS.  As I already wrote.

> The content of the comment in the <script> in that example has 
> 
>  document.write('</script>');     }
> 
> that causes SGML parser to end script element in that place (and anything
> after it is dumped as normal text).

That is the correct thing to do.  THE PAGE IS BROKEN.

>  Seems fixing content of HTML_SCRIPT to something else (seems SGML_PCDATA is
> best) fixes it. 

That's not a fix, that is breaking lynx's parsing which is handling
correct SCRIPT content correctly.

> But correct me (if something better than SGML_PCDATA should be
> used or that T_SCRIPT must be modified).
>  Patch attached (it fixes the problem). 

It seems you don't understand what the problem is.
The parsing with -prettysrc needs correcting, you are breaking the
regular parsing instead to do the same broken thing.

It should be SGML_CDATA, but that isn't really implemented, the closest
is SGML_LITTERAL, so it has to stay SGML_LITTERAL.  Look at SGML.c,
SGML_PCDATA is just the same as SGML_MIXED (except for some difference
regarding &zwnj; that should probably not be there), and SGML_MIXED
parsing for SCRIPT content is certainly wrong.  See the HTML spec for
what CDATA _as element content_ means.  It has to be parsed "literally".

   Klaus


reply via email to

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