style keyword does not allow to save content in DB (using TinyMCE)

style keyword does not allow to save content in DB (using TinyMCE)

by Jaswant Tak -
Number of replies: 2

Hi All,

I am having an strange issue, I've gone through entire forums but could not get any solution.

The problem is in my editor whenever I apply any CSS, like when I underline the text, the html code becomes 

<span style="text-decoration: underline;">Testing Style</span> 

Now when I save this, it is being saved as blank, meaning nothing is saved when style keyword is there.

If I remove style it is being saved and everything works fine

<span>Testing Style</span>

Could you please guide me, what is wrong with editor or DB.

I am using Moodle 2.1.2

Thank you

Average of ratings: -
In reply to Jaswant Tak

Re: style keyword does not allow to save content in DB (using TinyMCE)

by Mauno Korpelainen -

It might be caused by some other thing , not necessarely your editor - I remember some cases from the past where settings of mod_security removed all css from saved html tags. The other possible reason might be some html element (attribute) validation bug or wrong rules in tinymce valid_elements but I can't reproduce such things in my current test installs.

<span style="text-decoration: underline;">Testing Style</span>  renders underlined text fine here as you can see:


Testing Style

In reply to Mauno Korpelainen

Re: style keyword does not allow to save content in DB (using TinyMCE)

by Jaswant Tak -

Hello Mauno,

Thanks for the reply, if I try with this HTML, it is not being saved.

<p><span style="text-decoration: underline;">1</span></p>
<p><span style="text-decoration: underline;">2</span></p>
<p><span style="text-decoration: underline;">3</span></p>
<p><span style="text-decoration: underline;">4</span></p>
<p><span style="text-decoration: underline;">5</span></p>
 
Even on my local installation is if fine.  Not sure whats wrong there on server.
Thanks