For example:
- My CKeditor does not have the link button enabled
- When adding content I "switch to plain text editor"
- I add html containing an a tag link
- I save the node then edit it, or "switch to rich text editor"
- The a tag is stripped even though it is an allowed tag (happens in filtered and full html)

This seems to be happening for all editor buttons.


aivanov_100’s picture

I spent some time troubleshooting this specific scenario:

- My CKeditor profile for Filtered Html has the link button disabled
- When adding content I "switch to plain text editor"
- I add html containing an a tag link
- I save the node. Link displays correctly when viewing the node.
- I go to edit the node.. I see that the a tag has disappeared from the content. The link text remains inside p tags

- CKEditor JS library version: 4.1.1

I stepped through the PHP code in this module that is responsible for the output to the wysiwyg textarea, namely the ckeditor_pre_render_text_format() and ckeditor_profile_load() functions. I also stepped through the JS code provided by this module, in ckeditor.utils.js, which is executed when CKEditor loads on a page.

It looks like the code in this module is correctly providing the data for the wysiwyg textarea.. the data returned by both the PHP and JS functions contained the link in the proper format with the a tag present. The a tag was stripped after additional functions from the CKEditor JS library (/libraries/ckeditor/ckeditor.js) were executed.

This issue did indeed go away once I added the "link" button to my CKEditor toolbar

dogmatix’s picture

If you're using the 4.1+ CKEditor then this behavior is caused by the Advanced Content Filter as explained in the CKEditor project page. Disable the filter and it will stop stripping stuff for which you don't have a button in your toolbar.

sheise’s picture

Great, that works. Thank you.

xurizaemon’s picture

To disable the ACF (please read ACF docs on why it exists before doing so),

admin/config/content/ckeditor → (your full HTML format) → edit → advanced options → custom javascript configuration → config.allowedContent = true;

(this suggestion is given on the project page @ also)

Jemian’s picture

Issue summary: View changes

Thank you for your help. I had this problem as well. You solved it.