I'm using CKEditor Module 7.x-1.15 with CKEditor v4.4.4. This is applied to the Drupal 'Filtered HTML' text format.

I want to filter out <DIV> tags, so have checked 'Limit allowed HTML tags' in the text format settings.

If I enter <DIV>test</DIV> into the field, CKEditor converts this to &lt;div&gt;test&lt;/div&gt;. So upon save, the filter doesn't recognise the tag and <DIV>test</DIV> still displays when viewing the node.

By default, CKEditor is escaping HTML entities.

In the CKEditor profile settings, there is an option to set HTML Entities to No but it seems to make no difference.

I was able to force config.basicEntities = FALSE; into the Custom JavaScript Configuration setting. But this seems to generate lots of extraneous <P> tags.

Is it better to disable the core text format filter, and try using a CKEditor plugin to strip tags instead?

  • &lt;div&gt; is not a tag, so everything works exactly as expected, isn't it? Why would you want to forbid your users to write about <div> tags? Makes no sense to me. – Mołot Sep 4 '14 at 16:46
  • I see your point. But <div> is a tag, and users have a habit of pasting them into text fields along with other 'not allowed' markup. Surely that's the purpose of a having a 'limit allowed HTML tags' filter in core? – pushka Sep 4 '14 at 19:52
  • Purpose was to prevent users from breaking your layout with tags, not to prevent them from talking about tags - and talking about tags is all they actually can do now. – Mołot Sep 4 '14 at 21:28
  • If I disable wysiwyg on the filtered text format, Drupal correctly strips out div tags. When enabled, CKEditor prevents this from happening. That is the issue here. – pushka Sep 5 '14 at 8:55

protected by Community May 26 '15 at 13:03

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Browse other questions tagged or ask your own question.