ckeditor5 icon indicating copy to clipboard operation
ckeditor5 copied to clipboard

Allow any html tags to be used in the content

Open moesjarraf opened this issue 9 years ago • 3 comments

Hi,

In the previous ckeditor version there was a config option which allowed any html tags to be used in the content, as is, without overwriting/modifying the tags. The config options were called allowedContent and extraAllowedContent. It was also possible to set a fullPage option, so <html> and <head> tags were allowed.

Are these properties still supported in some way? If not, how would I achieve a similar effect?

moesjarraf avatar Nov 20 '17 15:11 moesjarraf

Hi, inserting arbitrary HTML is not possible in CKE5. This is for a few reasons.

Mostly because CKE5, in contrary to v4, operates basing on a custom data model. Each "feature" has its own representation in custom data tree inside the editor. That means that the editor no longer "understands" any HTML, as every HTML bit has to be translated to an element in the model tree.

Other three reasons are:

  • focusing more on content creation, not HTML creation,
  • trying to produce semantically correct HTML,
  • complications in algorithms - we want our features to work perfectly, which is difficult when any HTML can be inserted into the editor.

@Reinmar gives some more insight on this here: https://github.com/ckeditor/ckeditor5/issues/592#issuecomment-335108129. You may want to read the whole discussion to learn more about our approach.

Of course, there's always a way around. It would be possible to provide a plugin which will convert all unrecognized elements/classes/styles to elements/attributes in the model and then back to the view. However, it is not something that we would recommend, encourage to, or put in official builds.

scofalik avatar Nov 20 '17 15:11 scofalik

Similar question was raised here: https://github.com/ckeditor/ckeditor5/issues/664

scofalik avatar Nov 20 '17 15:11 scofalik

@scofalik Is there any sample example where we can implement and enable some basic HTML tags like input and dropdown.

iridescentapps avatar Jan 07 '19 14:01 iridescentapps