Make TinyMCE more tolerant about HTML elements - #3437
Conversation
|
@singingwolfboy FYI, this is the change I'd like to get in to this week's release if possible. |
There was a problem hiding this comment.
Is it intended behavior for the code editor to add the "p" and "/p" tags around the img?
There was a problem hiding this comment.
I think this is fine (and would be impossible to prevent).
There was a problem hiding this comment.
This is just something that TinyMCE does to clean up the HTML, so there's nothing we can do about it (I tried all the options I could find). Unfortunately this is one of the complaints we have received, because users don't like their HTML getting extra tags. It is especially bad when it decides to turn trailing whitespace into
.
|
FYI, I had more integration tests but I had to remove them because they weren't passing and I couldn't find a way to disable them. I'll see if I can develop more this morning. |
|
@cahrens I've removed verify_html since you pointed out that TinyMCE dropped support for it in 4. That explains why it didn't seem to help! |
|
👍 |
|
👍 Although I would like to assess our overall security framework regarding 3rd party code at some point. |
Make TinyMCE more tolerant about HTML elements
STUD-1565
This change improves TinyMCE's handling of some HTML elements (e.g. span tags, math tags etc) but doesn't completely solve the issues our users are reporting:
http://help.edge.edx.org/discussions/problems/4718-help-me-understand-what-studio-strips-from-my-code
In particular, TinyMCE will still rewrite the user's HTML, losing whitespace, comments etc. It also loses tags which strictly speaking aren't allowed outside the head tag, but for some reason seems to be used as a workaround in most browsers. I tried all of the TinyMCE options I could find, but I think I've hit the limit now.
@cahrens Let me know whether you think this is a net win, or whether it doesn't get us far enough. Either way, we still need your changes, I believe.
@nasthagiri Could you also review this when you have a chance.