[w3m-dev 03496] parse <!-- ... --> in <script>

* etc.c (read_token): check <pre>
* file.c (HTMLlineproc0): remove comment processing
		check pre mode
		comment processing move
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2002-11-27 16:39:13 +00:00
parent 09c3eb83b9
commit 7b5f6ea99c
3 changed files with 45 additions and 7 deletions

15
etc.c
View File

@@ -1,4 +1,4 @@
/* $Id: etc.c,v 1.40 2002/11/24 16:02:22 ukai Exp $ */
/* $Id: etc.c,v 1.41 2002/11/27 16:39:17 ukai Exp $ */
#include "fm.h"
#include <pwd.h>
#include "myctype.h"
@@ -755,8 +755,10 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
}
if (prev_status == R_ST_NCMNT2 || prev_status == R_ST_NCMNT3 ||
prev_status == R_ST_IRRTAG || prev_status == R_ST_CMNT1) {
if (prev_status == R_ST_CMNT1 && !append)
if (prev_status == R_ST_CMNT1 && !append && !pre)
Strclear(buf);
if (pre)
Strcat_char(buf, *p);
p++;
goto proc_end;
}
@@ -779,7 +781,10 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
}
if (*status == R_ST_TAG0 && !REALLY_THE_BEGINNING_OF_A_TAG(p)) {
/* it seems that this '<' is not a beginning of a tag */
/*
Strcat_charp(buf, "&lt;");
*/
Strcat_char(buf, '<');
*status = R_ST_NORMAL;
}
else
@@ -793,7 +798,9 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
break;
case R_ST_CMNT:
case R_ST_IRRTAG:
if (!append)
if (pre)
Strcat_char(buf, *p);
else if (!append)
Strclear(buf);
break;
case R_ST_CMNT1:
@@ -802,6 +809,8 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
case R_ST_NCMNT2:
case R_ST_NCMNT3:
/* do nothing */
if (pre)
Strcat_char(buf, *p);
break;
}
}