[Top][All Lists]

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

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

From: Hynek Med
Subject: LYNX-DEV No more "** Bad HTML!! No form action defined. **"
Date: Sat, 29 Mar 1997 18:24:03 +0100 (MET)

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. 

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
assuming their ending, so we don't lose the most valuable information. So
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..

What do you think? Should something like this be incorporated in future
versions of lynx?


Hynek Med, address@hidden

--- SGML.c.orig Sat Mar 29 15:49:27 1997
+++ SGML.c      Sat Mar 29 17:30:42 1997
@@ -530,7 +530,9 @@
        HTTag * t = N->tag;
        if (old_tag != t) {             /* Mismatch: syntax error */
-           if (context->element_stack->next) { /* This is not the last level */
+           if (context->element_stack->next && !(strcmp (t->name, "FORM"))
+               && !(strcmp (t->name, "A")))
+           {   /* This is not the last level nor FORM nor A tag */
                if (TRACE) fprintf(stderr,
                "SGML: Found </%s> when expecting </%s>. </%s> assumed.\n",
                    old_tag->name, t->name, t->name);

reply via email to

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