0

I have the CKEditor module installed, and it has a place to configure the allowed tags, but the list of allowed tags that you are allowed to... allow is very anemic. Is there a way to stop it from stripping tags (or any other tag for that matter)?

2

This answer is for future reference

Checkout the WYSIWYG Filter

The WYSIWYG Filter module provides an input filter that allows site administrators configure which HTML elements, attributes and style properties are allowed. It also may add rel="nofollow" to posted links based on filter options. It can do so with no additional parsing on user input. That is, it may apply nofollow rules while parsing HTML elements and attributes.

The filter is based on whitelists that can be defined from the filter settings panel. Rules for HTML element and attributes are defined using the same syntax of the TinyMCE valid_elements option.

HTML attributes related to DOM events (on*) are not allowed for security reasons (to prevent XSS, etc.).

The following elements cannot be whitelisted due to security reasons, to prevent users from breaking site layout and/or to avoid posting invalid HTML. Forbidden elements: applet, area, base, basefont, body, button, embed, form, frame, frameset, head, html, iframe, input, isindex, label, link, map, meta, noframes, noscript, object, optgroup, option, param, script, select, style, textarea, title.

Please refer to the project page for more details.

1

If you go to admin/config/content/formats/ you can select the text_format that ckeditor module is being used on and then adjust the relevant filters for the text format. The one you will want to look at is Limit allowed HTML tags where you can add exceptions for whichever you like.

1
  • The problem is CKEditor stripping the tags at the JS level, not drupal.
    – Joren
    Jan 24 '12 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.