mothra: simpler approach to ignoring <script> tags
This commit is contained in:
parent
f57e4ecb01
commit
2fd758bf2a
1 changed files with 7 additions and 22 deletions
|
@ -1007,28 +1007,6 @@ void plrdhtml(char *name, int fd, Www *dst){
|
||||||
case Tag_isindex:
|
case Tag_isindex:
|
||||||
rdform(&g);
|
rdform(&g);
|
||||||
break;
|
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;
|
break;
|
||||||
|
|
||||||
|
@ -1101,6 +1079,13 @@ void plrdhtml(char *name, int fd, Www *dst){
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TEXT:
|
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))){
|
if(g.state->link[0]==0 && (str = linkify(g.token))){
|
||||||
nstrcpy(g.state->link, str, sizeof(g.state->link));
|
nstrcpy(g.state->link, str, sizeof(g.state->link));
|
||||||
pl_htmloutput(&g, g.nsp, g.token, 0);
|
pl_htmloutput(&g, g.nsp, g.token, 0);
|
||||||
|
|
Loading…
Reference in a new issue