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: Vlad Harchev
Subject: Re: lynx-dev bug in comments process
Date: Sat, 31 Jul 1999 19:38:56 +0500 (SAMST)

On Fri, 30 Jul 1999, Klaus Weide wrote:

> On Thu, 29 Jul 1999, Klaus Weide wrote:
> > On Thu, 29 Jul 1999, Eduardo Chappa L. wrote:
> > 
> > >   Well here is a web page where there is a series of <script> </script>
> > > tags that are misunderstood by lynx. The output you see includes the
> > > comments after one </script> inside a comment in the header.
> > 
> > Read <http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.3.2.1>.
> > (Well, *they* should read it.)  There are better explanations out their.
> >                                                       I hate this...^
> > What looks like the start of a comment to you isn't really one to SGML,
> > since it is within SCRIPT content.
> >
> > >   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. 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).

 Seems fixing content of HTML_SCRIPT to something else (seems SGML_PCDATA is
best) fixes it. 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). 

 Best regards,
  -Vlad

--- HTMLDTD.c-orig      Sat Jul 31 04:38:09 1999
+++ HTMLDTD.c   Sat Jul 31 19:33:00 1999
@@ -1473,7 +1473,7 @@
  { P("Q")      , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_Q},
  { P("S")      , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_S},
  { P0("SAMP")  , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_SAMP},
- { P("SCRIPT") , script_attr,  HTML_SCRIPT_ATTRIBUTES, SGML_LITTERAL,T_SCRIPT},
+ { P("SCRIPT") , script_attr,  HTML_SCRIPT_ATTRIBUTES, SGML_PCDATA,T_SCRIPT},
  { P("SELECT") , select_attr,  HTML_SELECT_ATTRIBUTES, SGML_MIXED,T_SELECT},
  { P("SHY")    , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_EMPTY,T_SHY},
  { P("SMALL")  , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_SMALL},
@@ -1594,7 +1594,7 @@
  { P("Q")      , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_Q},
  { P("S")      , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_S},
  { P0("SAMP")  , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_SAMP},
- { P("SCRIPT") , script_attr,  HTML_SCRIPT_ATTRIBUTES, SGML_LITTERAL,T_SCRIPT},
+ { P("SCRIPT") , script_attr,  HTML_SCRIPT_ATTRIBUTES, SGML_PCDATA,T_SCRIPT},
  { P("SELECT") , select_attr,  HTML_SELECT_ATTRIBUTES, SGML_ELEMENT,T_SELECT},
  { P("SHY")    , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_EMPTY,T_SHY},
  { P("SMALL")  , gen_attr,     HTML_GEN_ATTRIBUTES,    SGML_MIXED,T_SMALL},


reply via email to

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