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:
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?
Try using a some CSS parser (like http://cssparser.sourceforge.net/) and SAC.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With