From e718702d1281d1e92d162d9846081364ebb5f4df Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Thu, 23 Jan 2003 18:01:01 +0000 Subject: * etc.c (next_status): after = is R_ST_VALUE R_ST_VALUE > => R_ST_NORMAL R_ST_VALUE SP => R_ST_TAG (read_token): R_ST_VALUE (correct_irrtag): R_ST_VALUE * rm.h (R_ST_VALUE): added (ST_IS_REAL_TAG): rewrite (ST_IS_COMMENT): deleted (ST_IS_TAG): deleted * parsetagx.c (parse_tag): skip too long tagname skip too long attrname if attrvalue has quote char, need reconstruct if unknown attr, need reconstruct * table.c (visible_length): R_ST_VALUE From: Hironori SAKAMOTO --- parsetagx.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) (limited to 'parsetagx.c') diff --git a/parsetagx.c b/parsetagx.c index de51801..bda980d 100644 --- a/parsetagx.c +++ b/parsetagx.c @@ -1,4 +1,4 @@ -/* $Id: parsetagx.c,v 1.12 2002/12/24 17:20:48 ukai Exp $ */ +/* $Id: parsetagx.c,v 1.13 2003/01/23 18:01:07 ukai Exp $ */ #include "fm.h" #include "myctype.h" #include "indep.h" @@ -132,6 +132,9 @@ parse_tag(char **s, int internal) q++; } *p = '\0'; + while (*q && !IS_SPACE(*q) && !(tagname[0] != '/' && *q == '/') && + *q != '>') + q++; tag_id = getHash_si(&tagtable, tagname, HTML_UNKNOWN); @@ -165,11 +168,9 @@ parse_tag(char **s, int internal) *(p++) = TOLOWER(*q); q++; } - if (q == p) { - q++; - continue; - } *p = '\0'; + while (*q && *q != '=' && !IS_SPACE(*q) && *q != '>') + q++; SKIP_BLANKS(q); if (*q == '=') { /* get value */ @@ -201,8 +202,12 @@ parse_tag(char **s, int internal) q++; } else if (*q) { - while (*q && !IS_SPACE(*q) && *q != '>') - Strcat_char(value, *q++); + while (*q && !IS_SPACE(*q) && *q != '>') { + Strcat_char(value, *q); + if (!tag->need_reconstruct && html_quote_char(*q)) + tag->need_reconstruct = TRUE; + q++; + } } } for (i = 0; i < nattr; i++) { @@ -227,6 +232,9 @@ parse_tag(char **s, int internal) else tag->value[i] = NULL; } + else { + tag->need_reconstruct = TRUE; + } } skip_parse_tagarg: -- cgit v1.2.3