javatinymcexssantisamy

AntiSamy for TinyMce style attributes


I'm using the antisamy on text i get from tinymce editor.

I'm using the "antisamy-tinymce-1.4.4.xml" file from owaspantisam. (as the policy file).

My problem is that it destroys all of the style tags attributes of the string i get from the tinymce editor. for example: If i have a text which part of it is in red color , and other part is underlined - the string i will get after cleaning the html with antisamy will be all in the same color and it saves only the underline style attribute. how can i save other style attributes?? Is it worng to change the xml so it wont ignore style attributes?

Thank's In Advance.


Solution

  • You can always change the policy file according to your needs. check for property

    <property name="color" description="">
    

    under css-rules. check whether the color given matches the validation rules specified there.