From 129408103cd32e005de07956f5471fbf6404341e Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Sun, 18 Mar 2012 15:02:23 +0100 Subject: mothra: interpret table regardless of nesting --- sys/src/cmd/mothra/html.h | 1 - sys/src/cmd/mothra/rdhtml.c | 16 +++------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/sys/src/cmd/mothra/html.h b/sys/src/cmd/mothra/html.h index eb759244b..7654845a3 100644 --- a/sys/src/cmd/mothra/html.h +++ b/sys/src/cmd/mothra/html.h @@ -35,7 +35,6 @@ struct Stack{ int ismap; /* flag of */ int width; /* size of image */ int height; - int table; /* depth of table nesting */ char image[NNAME]; /* arg of */ char link[NNAME]; /* arg of */ char name[NNAME]; /* arg of */ diff --git a/sys/src/cmd/mothra/rdhtml.c b/sys/src/cmd/mothra/rdhtml.c index b6060c55c..5420b5c50 100644 --- a/sys/src/cmd/mothra/rdhtml.c +++ b/sys/src/cmd/mothra/rdhtml.c @@ -599,7 +599,6 @@ void plrdplain(char *name, int fd, Www *dst){ g.state->margin=0; g.state->indent=20; g.state->ismap=0; - g.state->table=0; g.dst=dst; g.hfd=fd; g.name=name; @@ -639,7 +638,6 @@ void plrdhtml(char *name, int fd, Www *dst){ g.state->ismap=0; g.state->width=0; g.state->height=0; - g.state->table=0; g.dst=dst; g.hfd=fd; g.name=name; @@ -718,16 +716,11 @@ void plrdhtml(char *name, int fd, Www *dst){ case Tag_html: case Tag_link: case Tag_nextid: - break; case Tag_table: - g.state->table++; break; case Tag_tr: - if(g.state->table==1){ - g.spacc=0; - g.linebrk=1; - } else - g.spacc++; + g.spacc=0; + g.linebrk=1; break; case Tag_td: g.spacc++; @@ -1057,11 +1050,8 @@ void plrdhtml(char *name, int fd, Www *dst){ case Tag_title: case Tag_ul: case Tag_xmp: - g.linebrk=1; - break; case Tag_table: - if(g.state->table==0) - g.linebrk=1; + g.linebrk=1; break; case Tag_pre: pl_linespace(&g); -- cgit v1.2.3