From 90d843e8fc4fc0c34d5db61b585da9ae970f0e92 Mon Sep 17 00:00:00 2001 From: Laurent MONIN Date: Tue, 6 Dec 2005 15:35:52 +0100 Subject: [PATCH] parse_table(): re-order code. --- src/document/html/parser/table.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/src/document/html/parser/table.c b/src/document/html/parser/table.c index 818c3eed..2ba20134 100644 --- a/src/document/html/parser/table.c +++ b/src/document/html/parser/table.c @@ -692,8 +692,24 @@ see: /* Beyond that point, opening tags only. */ if (closing_tag) goto see; + /* THEAD TBODY TFOOT */ + if (namelen == 5 + && ((!strlcasecmp(&name[1], namelen - 1, "HEAD", 4)) || + (!strlcasecmp(&name[1], namelen - 1, "BODY", 4)) || + (!strlcasecmp(&name[1], namelen - 1, "FOOT", 4)))) { + if (c_span) new_columns(table, c_span, c_width, c_al, c_val, 1); + + add_table_bad_html_end(table, html); + + group = 2; + goto see; + } + + /* Beyond this point, only two letters tags. */ + if (namelen != 2) goto see; + /* TR */ - if (namelen == 2 && toupper(name[1]) == 'R') { + if (toupper(name[1]) == 'R') { if (c_span) new_columns(table, c_span, c_width, c_al, c_val, 1); if (in_cell) { @@ -717,22 +733,7 @@ see: goto see; } - /* THEAD TBODY TFOOT */ - if (namelen == 5 - && ((!strlcasecmp(&name[1], namelen - 1, "HEAD", 4)) || - (!strlcasecmp(&name[1], namelen - 1, "BODY", 4)) || - (!strlcasecmp(&name[1], namelen - 1, "FOOT", 4)))) { - if (c_span) new_columns(table, c_span, c_width, c_al, c_val, 1); - - add_table_bad_html_end(table, html); - - group = 2; - goto see; - } - /* TD TH */ - if (namelen != 2) goto see; - if (toupper(name[1]) != 'D' && toupper(name[1]) != 'H') goto see; -- 2.11.4.GIT