Peter Krauss
Peter Krauss

Reputation: 13982

CKEditor4 destroy, not preserve original HTML content. How to disable filters?

I am using the standard demos, like this. So, the main options (little changes) can be flagged at config.js.

Example when edit by source-code-HTML (button Source): elements (tags) with class attribute, lost the attribute (class has been stripped out).

So, how to disable the "default filter"?

The "filtering by default" behaviour is a problem: is not backwards compatible, and, mainly, not a expected behaviour, because destroy the original content, that you must only change with editor.

Similar questions:

Upvotes: 0

Views: 2140

Answers (2)

hellork
hellork

Reputation: 420

We ran into this problem recently, 2017, version 5.5 developing a file load / save plugin and a speech recognition plugin for CKEditor (in progress). The above solutions helped, but also we had to use editor1.setData() to load the content into the editor.

Using select all and insertHTML() or insertText() methods was disrupting tags.

Upvotes: 0

Peter Krauss
Peter Krauss

Reputation: 13982

At config.js you can add something like,

  CKEDITOR.config.allowedContent=true;

see "Advanced Content Filter" (ACF) and how to enable/disable it.

Upvotes: 3

Related Questions