I'm using the Wysiwyg module with TinyMCE Editor 3.5.1.1.

I need to paste some html into a blog post and it has inline <style></style> tags. These are being stripped as soon as I enter them in the HTML source editor and click "update".

I'm using the Full HTML text format so "Limit Allowed HTML Tags" is not ticked and I tried disabling any HTML cleanup options temporarily to see if faulty HTML was the cause but no luck.

Comments

dodge created an issue. See original summary.

TwoD’s picture

Issue summary: View changes
Status: Active » Fixed

I think TinyMCE is stripping out style tags by default.
You'll have to add style tags to be valid children of the body tag:

/**
 * Implements hook_wysiwyg_editor_settings_alter().
 */
function MYMODULE_wysiwyg_editor_settings_alter(&$settings, $context) {
  if ($context['profile']->editor == 'tinymce') {
    $settings['valid_children'] = '+body[style]';
  }
}

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.