简体   繁体   English

JTidy保留CSS规则

[英]JTidy preserve CSS rules

Looking for a way to take some html like: 寻找一种采取类似html的方法:

  <html>
    <head>
      <style>
        *.td {
         font-weight: bold;
        } 
      </style>
    </head>
    <body>
       <div>blah blah blah</div>
     </body>
  </html>

And run it through JTidy, and keep the CSS rule in the output of the parser. 并通过JTidy运行它,并将CSS规则保留在解析器的输出中。

The tag is gone in the final output. 标签在最终输出中消失了。

That's not HTML. 那不是HTML。 It is a mixture of CSS and HTML. 它是CSS和HTML的混合体。 You can't expect an HTML processor to understand it the way you do. 您不能指望HTML处理器以您的方式理解它。

We had the word2000 flag set on JTidy. 我们在JTidy上设置了word2000标志。 That is stripping the style tags. 那就是剥离样式标签。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM