[Top][All Lists]

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

Re: LYNX-DEV No more "** Bad HTML!! No form action defined. **"

From: Klaus Weide
Subject: Re: LYNX-DEV No more "** Bad HTML!! No form action defined. **"
Date: Sat, 29 Mar 1997 14:37:54 -0600 (CST)

On Sat, 29 Mar 1997, Hynek Med wrote:

> I have written a dirty patch to SGML.c which makes lynx try to understand
> bad HTML documents, so it gets at least FORMs and anchors (A's) right, as
> I suggested some time ago. 

dirty indeed...

+           if (context->element_stack->next && !(strcmp (t->name, "FORM"))
+               && !(strcmp (t->name, "A")))
+           {   /* This is not the last level nor FORM nor A tag */

That cannot possibly do what you want.  Your code is equivalent to

+           if (FALSE)
+           {   /* This will never get executed */

Hint: strcmp() returns 0 if two strings match.
> With this patch, when lynx is about to assume an ending of a tag, it first
> checks if it's an A or a FORM, and if so, it just ignores it instead of

Well I am not an SGML geek, but I think you probably mean "...assume the
ending of an element", or "...assumen an omittted and tag".  

> assuming their ending, so we don't lose the most valuable information. So

In effect your checks whether an element still open when a non-matching 
end tag encountered is both a FORM and an A (which of course is never true),
and ignores the end tag in all other cases...

> you can get right bad forms (for example the advanced search on Lycos) and
> even such a bad HTML like this:
> <B><A HREF="something"></B>something</A>
> It's a very simple and dirty patch. (With my knowledge of C I couldn't
> write any better, anyway. :-) It should at least prompt the user with "Bad
> HTML, use -trace to diagnose", but I wasn't able to find out how to do
> this from within SGML.c..

I assume YOU have not used "-trace to diagnose", you should do that before
thinking about how to make Lynx tell other users what to do... :)

I am just pointing one flaw in your code, I am not saying that it would make
sense after changing that...


; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.

reply via email to

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