JPashs
JPashs

Reputation: 13896

Ckeditor delete some elements

In ckeditor editor and (ADDED) using Drupal 7

I click Html Source and paste:

<span><a href="#"><i class="fa fa-facebook"></i></a></span>

then ckeditor remove the a and the i elements to become:

<span></span>

The problem is that I can't put a i element inside an a element:

 <a href="#"><i class="fa fa-facebook"></i></a>

How can I solve this?

I had a similar problem with the span element which I solved adding in the Custom JavaScript configuration:

config.allowedContent = true;

Upvotes: 1

Views: 383

Answers (1)

electron
electron

Reputation: 810

allowedContent means ONLY allow these entities. extraAllowedContent means allow these entities in addition to default ones. So you can use one of these:

        CKEDITOR.replace('textarea_id', {
            allowedContent: 'span i a'
        });

Or

        CKEDITOR.replace('textarea_id', {
            extraAllowedContent: 'i a'
        });

Upvotes: 1

Related Questions