سؤال

Recently i am having a problem with CKeditor.

Integrated it very well into a custom CMS, however it seems to be stripping certain tags. Most importantly : 'data-toggle', 'data-target' and all of the font-awesome css classes.

Given I am using bootstrap for the templating engine, is there any resaon ,why this is happening.

Example :

<a class="btn btn-block btn-inverse" data-toggle="modal" data-target="#downloadModal" href="#">Download Trial</a>

Becomes:

<a class="btn btn-block btn-inverse" href="#">Download Trial</a>

Is there a set of HTML defined tags in CKeditor i could add to ? Or another editor which will play nicer ?

هل كانت مفيدة؟

المحلول

In your config.js file you can prevent any stripping by using the flag

    config.allowedContent = true;

Reference : http://ckeditor.com/ckeditor_4.3_beta/samples/datafiltering.html

Similar question concerning CSS Classes: CKEditor automatically strips classes from div

For added advice often the ckEditor will infact still strip certain tags out. If this is happening you can add the following again to your config.js file.

extraAllowedContent: 'data-toggle[*]{*}'
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top