Tinymce is removing the inline styles with repeated values

37 views Asked by At

I am loading a html to a tinymce 5 editor. If the html contains a div or table or any other element with same style values, the last one is being taken instead of all the values provided. Eg:

<div style="width: calc(100%-10px); width:10px;">Test Content</div> 

is modified to below:

<div style="width: calc(100%-10px);">Test Content</div>

I know it is a weird requirement. But I need this in my project. Please help

I tried various options like valid_elements, valid_children etc., but nothing seem to work

1

There are 1 answers

0
PRANESH On

Well, it will be good if you mention what is your exact requirement.

May be i think you should consider min-width and max-width.

In CSS, if you give two values for same property, it will use the last declaration applied to that property.