Java library for CSS cleanup

Posted by ndn on Stack Overflow See other posts from Stack Overflow or by ndn
Published on 2010-03-31T09:10:55Z Indexed on 2010/03/31 9:13 UTC
Read the original article Hit count: 469

Filed under:
|
|
|

For a rich text editor that has to handle pasted HTML code from MS Office applications, I'm looking for a Java library that cleans up the content of all "style" attributes in HTML elements, so that only some CSS attributes are left:

  • background-color
  • border
  • color
  • font-family
  • font-weight
  • font-style
  • list-style-type
  • text-align
  • text-decoration
  • vertical-align

For creating a well-formed HTML document, I can use JTidy. For HTML element transformations (removing unwanted elements), I can use http://htmlparser.sourceforge.net/

Is there anything comparable for CSS attributes?

© Stack Overflow or respective owner

Related posts about java

Related posts about html