lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [patch] HTML recovery trace/docs corrected


From: Leonid Pauzner
Subject: lynx-dev [patch] HTML recovery trace/docs corrected
Date: Wed, 17 Feb 1999 14:30:42 +0300 (MSK)

Occasionally I fall into a broken HTML and found -preparsed switch
very useful when deal with SortaSGML/TagSoup ^V key.

* More consistent docs for debugging of invalidly nested HTML:
  important trace messages from actions on invalid tags now have '***' prefix
  like "SGML: ... ***ignored" (well: illegal, forced, assumed, etc.),
  -preparsed mode now better documented.



diff -u old/lymain.c ./lymain.c
--- old/lymain.c        Mon Feb  8 18:58:32 1999
+++ ./lymain.c  Wed Feb 17 14:00:06 1999
@@ -2809,7 +2809,7 @@
 #ifdef DISP_PARTIAL
    PARSE_SET(
       "partial",       TOGGLE_ARG,             &display_partial,
-      "display partial pages while downloading"
+      "toggles display partial pages while downloading"
    ),
    PARSE_INT(
       "partial_thres",  IGNORE_ARG|INT_ARG,     partial_threshold,
@@ -2831,7 +2831,8 @@
    ),
    PARSE_SET(
       "preparsed",     SET_ARG,                &LYPreparsedSource,
-      "show parsed text/html with -source and in source view"
+      "show parsed text/html with -source and in source view\n\
+       to visualize how lynx behave with invalid HTML"
    ),
    PARSE_SET(
       "print",         UNSET_ARG,              &no_print,

diff -u old/lynx_use.htm ./lynx_use.htm
--- old/lynx_use.htm    Mon Jan 18 19:08:44 1999
+++ ./lynx_use.htm      Wed Feb 17 14:01:18 1999
@@ -2165,7 +2165,7 @@
             <dt><code>-number_links</code>
                <dd>force numbering of links.
             <dt><code>-partial</code>
-               <dd>display partial pages while downloading.
+               <dd>toggles display partial pages while downloading.
             <dt><code>-pauth=ID:PW</code>
                <dd>set authorization ID and password for a protected proxy
                    server at startup.  Be sure to protect any script files
@@ -2184,6 +2184,10 @@
             <dt><code>-preparsed</code>
                <dd>show source preparsed and reformatted when used with
                    -source or in source view ('<em>\</em>').
+                    May be useful for debugging of broken HTML markup
+                    to visualize the difference between SortaSGML and TagSoup
+                   <A HREF="keystrokes/option_help.html#tagsoup">recovery 
modes</A>,
+                    switched by '<em>^V</em>'.
             <dt><code>-print</code>
                <dd>enable print functions. (default)
             <dt><code>-pseudo_inlines</code>

diff -u old/sgml.c ./sgml.c
--- old/sgml.c  Mon Feb  8 19:05:32 1999
+++ ./sgml.c    Wed Feb 17 13:46:14 1999
@@ -312,7 +312,7 @@
        }
 #endif
     } else {
-       CTRACE(tfp, "SGML: Attribute value %s ignored\n", s);
+       CTRACE(tfp, "SGML: Attribute value %s ***ignored\n", s);
     }
     context->current_attribute_number = INVALID; /* can't have two 
assignments! */
 }
@@ -690,13 +690,13 @@
            if (canclose_check != close_NO) {
                CTRACE(tfp, "SGML: End </%s> \t<- %s end </%s>\n",
                            context->element_stack->tag->name,
-                           canclose_check == close_valid ? "supplied," : 
"forced by",
+                           canclose_check == close_valid ? "supplied," : 
"***forced by",
                            old_tag->name);
                do_close_stacked(context);
                extra_action_taken = YES;
                stackpos = is_on_stack(context, old_tag);
            } else {
-               CTRACE(tfp, "SGML: Still open %s \t<- invalid end </%s>\n",
+               CTRACE(tfp, "SGML: Still open %s \t<- ***invalid end </%s>\n",
                            context->element_stack->tag->name,
                            old_tag->name);
                return;
@@ -712,7 +712,7 @@
            return;
        }
        if (stackpos > 1) {
-           CTRACE(tfp, "SGML: Nesting <%s>...<%s> \t<- invalid end </%s>\n",
+           CTRACE(tfp, "SGML: Nesting <%s>...<%s> \t<- ***invalid end </%s>\n",
                        old_tag->name,
                        context->element_stack->tag->name,
                        old_tag->name);
@@ -737,7 +737,7 @@
            /*
            **  Ignore the end tag. - FM
            */
-           CTRACE(tfp, "SGML: Ignoring end tag </%s> in SELECT block.\n",
+           CTRACE(tfp, "SGML: ***Ignoring end tag </%s> in SELECT block.\n",
                        old_tag->name);
            return;
        }
@@ -747,7 +747,7 @@
     */
     CTRACE(tfp, "SGML: End </%s>\n", old_tag->name);
     if (old_tag->contents == SGML_EMPTY) {
-       CTRACE(tfp, "SGML: Illegal end tag </%s> found.\n",
+       CTRACE(tfp, "SGML: ***Illegal end tag </%s> found.\n",
                    old_tag->name);
        return;
     }
@@ -762,10 +762,10 @@

        if (old_tag != t) {             /* Mismatch: syntax error */
            if (context->element_stack->next) { /* This is not the last level */
-               CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> 
assumed.\n",
+               CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> 
***assumed.\n",
                            old_tag->name, t->name, t->name);
            } else {                    /* last level */
-               CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> 
Ignored.\n",
+               CTRACE(tfp, "SGML: Found </%s> when expecting </%s>. </%s> 
***Ignored.\n",
                            old_tag->name, t->name, old_tag->name);
                return;                 /* Ignore */
            }
@@ -815,14 +815,14 @@
            if (canclose_check != close_NO) {
                CTRACE(tfp, "SGML: End </%s> \t<- %s start <%s>\n",
                            context->element_stack->tag->name,
-                           canclose_check == close_valid ? "supplied," : 
"forced by",
+                           canclose_check == close_valid ? "supplied," : 
"***forced by",
                            new_tag->name);
                do_close_stacked(context);
                extra_action_taken = YES;
                if (canclose_check  == close_error)
                    direct_container = NO;
            } else {
-               CTRACE(tfp, "SGML: Still open %s \t<- invalid start <%s>\n",
+               CTRACE(tfp, "SGML: Still open %s \t<- ***invalid start <%s>\n",
                            context->element_stack->tag->name,
                            new_tag->name);
            }
@@ -831,7 +831,7 @@
            (context->element_stack->tag->flags & Tgf_strict) &&
            !(valid = element_valid_within(new_tag, context->element_stack->tag,
                                           direct_container))) {
-           CTRACE(tfp, "SGML: Still open %s \t<- ignoring start <%s>\n",
+           CTRACE(tfp, "SGML: Still open %s \t<- ***ignoring start <%s>\n",
                        context->element_stack->tag->name,
                        new_tag->name);
            return;
@@ -859,7 +859,7 @@
                                                   new_tag,
                                                   context->element_stack->tag,
                                                   direct_container))) {
-           CTRACE(tfp, "SGML: Still open %s \t<- invalid start <%s>\n",
+           CTRACE(tfp, "SGML: Still open %s \t<- ***invalid start <%s>\n",
                        context->element_stack->tag->name,
                        new_tag->name);
        }
@@ -905,14 +905,14 @@
                **  It is another form-related start tag, so terminate
                **  the current SELECT block and fall through. - FM
                */
-               CTRACE(tfp, "SGML: Faking SELECT end tag before <%s> start 
tag.\n",
+               CTRACE(tfp, "SGML: ***Faking SELECT end tag before <%s> start 
tag.\n",
                            new_tag->name);
                end_element(context, SGMLFindTag(context->dtd, "SELECT"));
            } else {
                /*
                **  Ignore the start tag. - FM
                */
-               CTRACE(tfp, "SGML: Ignoring start tag <%s> in SELECT block.\n",
+               CTRACE(tfp, "SGML: ***Ignoring start tag <%s> in SELECT 
block.\n",
                            new_tag->name);
                return;
            }
@@ -2744,7 +2744,7 @@
                    **  Don't treat these end tags as invalid,
                    **  nor act on them. - FM
                    */
-                   CTRACE(tfp, "SGML: `</%s%c' found!  Ignoring it.\n",
+                   CTRACE(tfp, "SGML: `</%s%c' found!  ***Ignoring it.\n",
                                string->data, c);
                    string->size = 0;
                    context->current_attribute_number = INVALID;
@@ -2782,14 +2782,14 @@
                            /*
                            **  It is not at FORM end tag, so ignore it. - FM
                            */
-                           CTRACE(tfp, "SGML: Ignoring end tag </%s> in SELECT 
block.\n",
+                           CTRACE(tfp, "SGML: ***Ignoring end tag </%s> in 
SELECT block.\n",
                                        string->data);
                        } else {
                            /*
                            **  End the SELECT block and then
                            **  handle the FORM end tag. - FM
                            */
-                           CTRACE(tfp, "SGML: Faking SELECT end tag before 
</%s> end tag.\n",
+                           CTRACE(tfp, "SGML: ***Faking SELECT end tag before 
</%s> end tag.\n",
                                        string->data);
                            end_element(context,
                                        SGMLFindTag(context->dtd, "SELECT"));
@@ -2805,7 +2805,7 @@
                        **  Treat a P end tag like a P start tag (Ugh,
                        **  what a hack! 8-). - FM
                        */
-                       CTRACE(tfp, "SGML: `</%s%c' found!  Treating as 
'<%s%c'.\n",
+                       CTRACE(tfp, "SGML: `</%s%c' found!  ***Treating as 
'<%s%c'.\n",
                                    string->data, c, string->data, c);
                        {
                            int i;



reply via email to

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