Diff for /XML/HTMLparser.c between versions 1.42 and 1.43

version 1.42, 2000/06/26 13:18:58 version 1.43, 2000/06/28 16:42:12
Line 388  char *htmlStartClose[] = { Line 388  char *htmlStartClose[] = {
 NULL  NULL
 };  };
   
   
 static char** htmlStartCloseIndex[100];  static char** htmlStartCloseIndex[100];
 static int htmlStartCloseIndexinitialized = 0;  static int htmlStartCloseIndexinitialized = 0;
   
Line 604  htmlAutoCloseOnClose(htmlParserCtxtPtr c Line 605  htmlAutoCloseOnClose(htmlParserCtxtPtr c
     }      }
 }  }
   
   /**
    * htmlCheckImplied:
    * @ctxt:  an HTML parser context
    * @new:  The new tag name
    *
    * The HTmL DtD allows a tag to exists only implicitely
    * called when a new tag has been detected and generates the
    * appropriates implicit tags if missing
    */
   void
   htmlCheckImplied(htmlParserCtxtPtr ctxt, const xmlChar *new) {
       if (!strcmp(new, "html"))
           return;
       if (ctxt->nameNr <= 0) {
   #ifdef DEBUG
           fprintf(stderr,"Implied element html: pushed html\n");
   #endif    
           htmlnamePush(ctxt, xmlStrdup(BAD_CAST"html"));
           if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
               ctxt->sax->startElement(ctxt->userData, BAD_CAST"html", NULL);
       }
       if ((!strcmp(new, "body")) || (!strcmp(new, "head")))
           return;
       if (ctxt->nameNr <= 1) {
           if ((!strcmp(new, "script")) || (!strcmp(new, "style")) ||
               (!strcmp(new, "meta")) || (!strcmp(new, "link")) ||
               (!strcmp(new, "title")) || (!strcmp(new, "base"))) {
               /* 
                * dropped OBJECT ... i you put it first BODY will be
                * assumed !
                */
   #ifdef DEBUG
               fprintf(stderr,"Implied element head: pushed head\n");
   #endif    
               htmlnamePush(ctxt, xmlStrdup(BAD_CAST"head"));
               if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
                   ctxt->sax->startElement(ctxt->userData, BAD_CAST"head", NULL);
           } else {
   #ifdef DEBUG
               fprintf(stderr,"Implied element body: pushed body\n");
   #endif    
               htmlnamePush(ctxt, xmlStrdup(BAD_CAST"body"));
               if ((ctxt->sax != NULL) && (ctxt->sax->startElement != NULL))
                   ctxt->sax->startElement(ctxt->userData, BAD_CAST"body", NULL);
           }
       }
   }
   
 /************************************************************************  /************************************************************************
  *                                                                      *   *                                                                      *
  *              The list of HTML predefined entities                    *   *              The list of HTML predefined entities                    *
Line 2222  htmlParseStartTag(htmlParserCtxtPtr ctxt Line 2271  htmlParseStartTag(htmlParserCtxtPtr ctxt
     htmlAutoClose(ctxt, name);      htmlAutoClose(ctxt, name);
   
     /*      /*
        * Check for implied HTML elements.
        */
       htmlCheckImplied(ctxt, name);
   
       /*
      * Now parse the attributes, it ends up with the ending       * Now parse the attributes, it ends up with the ending
      *       *
      * (S Attribute)* S?       * (S Attribute)* S?

Removed from v.1.42  
changed lines
  Added in v.1.43


Webmaster