User login

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.

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • You can use Markdown syntax to format and style the text. Also see Markdown Extra for tables, footnotes, and more.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <img> <blockquote> <small> <h2> <h3> <h4> <h5> <h6> <sub> <sup> <p> <br> <strike> <table> <tr> <td> <thead> <th> <tbody> <tt> <output>
  • Syntax highlight code surrounded by the {syntaxhighlighter SPEC}...{/syntaxhighlighter} tags, where SPEC is a Syntaxhighlighter options string or "class="OPTIONS" title="the title".
  • Lines and paragraphs break automatically.

More information about formatting options

By submitting this form, you accept the Mollom privacy policy.