我有一个用 perl 编写的过滤器,看起来像这样
my $tf = HTML::TagFilter->new(
allow => {
img => { src => [] },
b => { all => [] },
i => { all => [] },
em => { all => [] },
u => { all => [] },
s => { all => [] },
},
strip_comments => 1,
skip_xss_protection => 1,
);
现在当我像这样传递 html
<html>
<head>
<style><!--
..hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 12pt=3B
font-family:Calibri
}
--></style></head>
<body class=3D'hmmessage'><div dir=3D'ltr'>Message content here! =
</div></body>
</html>
输出是
<!--..hmmessage P{margin:0px;padding:0px}body.hmmessage{font-size: 12pt;font-family:Calibri}-->Message content here
如果你看输出你发现style标签的内容仍然存在,我不知道为什么?那么谁能告诉我为什么通过过滤器后style标签内容仍然存在?