TinyMCE in WYSIWYG API destroys HTML it does not like no matter what the settings
A client wanted to center an embedded video and was disabling rich text in order to add tags around it to center it. Save it and it works, but edit the node and the WYSIWYG would strip the new tags and break the formatting on save. Granted, these are deprecated tags that were being used but it is not the WYSIWYG's place to be enforcing that.
Unchecking Paste from Word button and unchecking all of these and TinyMCE still deletes center or div align="center" tags.
Verify HTML
If enabled, potentially malicious code like tags will be removed from HTML contents.
Convert tags to styles
If enabled, HTML tags declaring the font size, font family, font color and font background color will be replaced by inline CSS styles.
Remove linebreaks
If enabled, the editor will remove most linebreaks from contents. Disabling this option could avoid conflicts with other input filters.
Apply source formatting
If enabled, the editor will re-format the HTML source code. Disabling this option could avoid conflicts with other input filters.
Force cleanup on standard paste
If enabled, the default paste function (CTRL-V or SHIFT-INS) behaves like the "paste from word" plugin function.
In this case the work-around was simple enough, use the TinyMCE WYSIWYG editor's preferred <p style="text-align: center;">.
But it really shouldn't be messing with HTML, even deprecated HTML, if it is instructed not to.
More like this
- TinyMCE, iFrames, JQuery and Drupal scattered notes
- Creating a word paste plugin for TinyMCE
- MarkItUp HTML markup for textareas using JQuery with Drupal WYSIWYG API integration
- Site layout destroyed by weird invisible character in stylesheet
- Make a CCK textfield act on the break tag like the Drupal core node body does


Comments
Post new comment