summaryrefslogtreecommitdiff
path: root/sys/src/cmd/mothra/rdhtml.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2012-09-10 03:09:30 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2012-09-10 03:09:30 +0200
commit2fd758bf2a32d49731d477af6aa18ef763e20937 (patch)
treee06666518720c5d8471a10fc2d5a12791eb07282 /sys/src/cmd/mothra/rdhtml.c
parentf57e4ecb015db6b1f7f4e1db1efa76dc9b1fadcc (diff)
mothra: simpler approach to ignoring <script> tags
Diffstat (limited to 'sys/src/cmd/mothra/rdhtml.c')
-rw-r--r--sys/src/cmd/mothra/rdhtml.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/sys/src/cmd/mothra/rdhtml.c b/sys/src/cmd/mothra/rdhtml.c
index a4dff1089..13a1dfe1d 100644
--- a/sys/src/cmd/mothra/rdhtml.c
+++ b/sys/src/cmd/mothra/rdhtml.c
@@ -1007,28 +1007,6 @@ void plrdhtml(char *name, int fd, Www *dst){
case Tag_isindex:
rdform(&g);
break;
- case Tag_script:
- case Tag_object:
- case Tag_applet:
- case Tag_style:
- /*
- * ignore the content of these tags, eat tokens until we
- * reach a matching endtag.
- */
- t = g.tag;
- for(;;){
- switch(pl_gettoken(&g)){
- default:
- continue;
- case ENDTAG:
- if(g.tag != t)
- continue;
- case EOF:
- break;
- }
- break;
- }
- break;
}
break;
@@ -1101,6 +1079,13 @@ void plrdhtml(char *name, int fd, Www *dst){
}
break;
case TEXT:
+ switch(g.state->tag){
+ case Tag_script:
+ case Tag_object:
+ case Tag_applet:
+ case Tag_style:
+ continue;
+ }
if(g.state->link[0]==0 && (str = linkify(g.token))){
nstrcpy(g.state->link, str, sizeof(g.state->link));
pl_htmloutput(&g, g.nsp, g.token, 0);