ref: 129408103cd32e005de07956f5471fbf6404341e
parent: 847d238ca202a84523c057fb929f690447b728ed
author: cinap_lenrek <[email protected]>
date: Sun Mar 18 11:02:23 EDT 2012
mothra: interpret table regardless of nesting
--- a/sys/src/cmd/mothra/html.h
+++ b/sys/src/cmd/mothra/html.h
@@ -35,7 +35,6 @@
int ismap; /* flag of <img> */
int width; /* size of image */
int height;
- int table; /* depth of table nesting */
char image[NNAME]; /* arg of <img> */
char link[NNAME]; /* arg of <a href=...> */
char name[NNAME]; /* arg of <a name=...> */
--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -599,7 +599,6 @@
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 @@
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 @@
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 @@
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);