HTTrack Website Copier
Free software offline browser - FORUM
Subject: Re: beta releases downloads - broken links
Author: Xavier Roche
Date: 05/12/2012 16:40
 
> I installed beta release, but the problem with js
> parsing

Darn, you're right. Not fixed yet for beta-2, but should be commited in the
next one.

In the meantime, the real fix:

Index: src/htsparse.c
===================================================================
--- src/htsparse.c      (révision 109)
+++ src/htsparse.c      (révision 110)
@@ -460,6 +460,7 @@
       int intag=0;         // on est dans un tag
       int incomment=0;     // dans un <!--
       int inscript=0;      // dans un scipt pour applets javascript)
+      int inscript_locked=0;  // in locked script (ie. js file)
       signed char inscript_state[10][257];
       typedef enum {
         INSCRIPT_START=0,
@@ -522,8 +523,8 @@
       inscript_state[INSCRIPT_COMMENT2][INSCRIPT_DEFAULT]=INSCRIPT_COMMENT;
       inscript_state[INSCRIPT_COMMENT2]['/']=INSCRIPT_START;
       inscript_state[INSCRIPT_COMMENT2]['*']=INSCRIPT_COMMENT2;
-     
inscript_state[INSCRIPT_ANTISLASH_IN_QUOTE][INSCRIPT_DEFAULT]=INSCRIPT_INQUOTE;   
/* #8: escape in "" */
-     
inscript_state[INSCRIPT_ANTISLASH_IN_QUOTE2][INSCRIPT_DEFAULT]=INSCRIPT_INQUOTE2; 
/* #9: escape in '' */
+     
inscript_state[INSCRIPT_ANTISLASH_IN_QUOTE][INSCRIPT_DEFAULT]=INSCRIPT_INQUOTE;   
/* #8: escape in '' */
+     
inscript_state[INSCRIPT_ANTISLASH_IN_QUOTE2][INSCRIPT_DEFAULT]=INSCRIPT_INQUOTE2; 
/* #9: escape in "" */

       /* Primary list or URLs */
       if (ptr == 0) {
@@ -537,6 +538,7 @@
         || (compare_mime(opt,r->contenttype, str->url_file, "text/css")!=0)
         ) {      /* JavaScript js file */
           inscript=1;
+          inscript_locked=1;  /* Don't exit js space upon </script> */
           if (opt->parsedebug) { HT_ADD("<@@ inscript @@>"); }
           inscript_name="script";
           intag=1;     // because apr&#65533;s <script> on y est .. - pas
utile
@@ -1308,6 +1310,7 @@
                     ||
                     (strfield(adr,"/style")  && strfield(inscript_name,
"style"))
                     )
+                    && inscript_locked == 0
                     ) {
                       char* a=adr;
                       //while(is_realspace(*(--a)));

 
Reply Create subthread


All articles

Subject Author Date
Re: beta releases downloads - broken links 05/09/2012 22:16
Re: beta releases downloads - broken links 05/10/2012 06:33
Re: beta releases downloads - broken links 05/12/2012 16:40




e

Created with FORUM 2.0.11