* 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 <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2003-01-23 18:01:01 +00:00
parent 51c2899aa9
commit e718702d12
5 changed files with 49 additions and 16 deletions

View File

@@ -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: