aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-27 16:39:13 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-27 16:39:13 +0000
commit7b5f6ea99c626ab25b5636921336109c329617d7 (patch)
tree72db86d3cefb7c119eef0246b7ead94ac4fbf6fc
parent[w3m-dev 03495] local CGI can't work (diff)
downloadw3m-7b5f6ea99c626ab25b5636921336109c329617d7.tar.gz
w3m-7b5f6ea99c626ab25b5636921336109c329617d7.zip
[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>
Diffstat (limited to '')
-rw-r--r--ChangeLog10
-rw-r--r--etc.c15
-rw-r--r--file.c27
3 files changed, 45 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8876f9c..d478722 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+ * [w3m-dev 03496] parse <!-- ... --> in <script>
+ * etc.c (read_token): check <pre>
+ * file.c (HTMLlineproc0): remove comment processing
+ check pre mode
+ comment processing move
+
+2002-11-28 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
+
* [w3m-dev 03495] local CGI can't work
* local.c: #include "hash.h"
(set_environ): env string put in hash
@@ -5226,4 +5234,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.568 2002/11/27 16:35:18 ukai Exp $
+$Id: ChangeLog,v 1.569 2002/11/27 16:39:13 ukai Exp $
diff --git a/etc.c b/etc.c
index 0f98636..37126db 100644
--- a/etc.c
+++ b/etc.c
@@ -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;
}
}
diff --git a/file.c b/file.c
index ade443d..a4f9f5e 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.132 2002/11/26 18:03:24 ukai Exp $ */
+/* $Id: file.c,v 1.133 2002/11/27 16:39:18 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -5421,6 +5421,7 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
fclose(f);
}
+#if 0
/* comment processing */
if (obuf->status == R_ST_CMNT || obuf->status == R_ST_NCMNT3 ||
obuf->status == R_ST_IRRTAG) {
@@ -5431,6 +5432,7 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
if (obuf->status != R_ST_NORMAL)
return;
}
+#endif
tokbuf = Strnew();
@@ -5444,13 +5446,25 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
while (*str != '\0') {
int is_tag = FALSE;
+ int pre_mode = (obuf->table_level >= 0) ?
+ tbl_mode->pre_mode & TBLM_PLAIN :
+ obuf->flag & RB_PLAINMODE;
if (obuf->flag & RB_PLAIN)
goto read_as_plain; /* don't process tag */
+ if (ST_IS_COMMENT(obuf->status)) {
+ read_token(h_env->tagbuf, &str, &obuf->status, pre_mode, 1);
+ if (obuf->status != R_ST_NORMAL)
+ return;
+ if (pre_mode) {
+ is_tag = TRUE;
+ q = h_env->tagbuf->ptr;
+ goto read_as_pre_mode;
+ }
+ continue;
+ }
if (*str == '<' || ST_IS_TAG(obuf->status)) {
- int pre_mode = (obuf->table_level >= 0) ?
- tbl_mode->pre_mode & TBLM_PLAIN : obuf->flag & RB_PLAINMODE;
/*
* Tag processing
*/
@@ -5462,12 +5476,15 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
if (!REALLY_THE_BEGINNING_OF_A_TAG(str)) {
/* this is NOT a beginning of a tag */
obuf->status = R_ST_NORMAL;
+ if (pre_mode)
+ goto read_as_pre_mode;
HTMLlineproc1("&lt;", h_env);
str++;
continue;
}
read_token(h_env->tagbuf, &str, &obuf->status, pre_mode, 0);
}
+#if 0
if (ST_IS_COMMENT(obuf->status)) {
if ((obuf->table_level >= 0) ? tbl_mode->pre_mode & TBLM_IGNORE
: obuf->flag & RB_IGNORE)
@@ -5476,6 +5493,7 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
obuf->status = R_ST_NORMAL;
return;
}
+#endif
if (h_env->tagbuf->length == 0)
continue;
if (obuf->status != R_ST_NORMAL) {
@@ -5501,6 +5519,7 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
q = h_env->tagbuf->ptr;
}
+ read_as_pre_mode:
if (obuf->flag & (RB_INTXTA | RB_INSELECT | RB_IGNORE)) {
cmd = HTML_UNKNOWN;
if (!is_tag) {
@@ -5519,6 +5538,8 @@ HTMLlineproc0(char *str, struct html_feed_environ *h_env, int internal)
if (obuf->flag & RB_INTXTA) {
if (cmd == HTML_N_TEXTAREA)
goto proc_normal;
+ if (is_tag)
+ continue;
feed_textarea(q);
}
else if (obuf->flag & RB_INSELECT) {