


The elements the user wants to be supported, need to be configured via the config.htmlSupport option: ClassicEditor.create( document.querySelector( '#editor' ), ) ĭataFilter. # Configurationīy default, enabling the GeneralHtmlSupport plugin does not enable support for any given element. Introducing basic support for missing HTML features at a low cost.Ensuring backwards content compatibility with legacy systems.Therefore, GHS’s main use cases would be: It is, in this respect, similar to the content filtering (ACF) feature from CKEditor 4 as it lets you create a set or a list of markup tags that will not be stripped. The GHS will know that a is a container element, so it can wrap other blocks (like paragraphs) but cannot be used inline (next to e.g. If you enable support for s via GHS, the user will not be able to create s from the editor UI. The General HTML Support does not offer any UI for the enabled features and takes only the basic semantics of a given feature into account. The headings feature offers a dropdown from which the user can choose a heading level and ensures that pressing Enter at the end of a heading creates a new paragraph (and not another heading). Together with the autoformatting feature, it also allows for applying bold style to content by typing a Markdown shortcode ( **foo**) in the editor. The difference between specific CKEditor 5 features such as basic styles or headings and the HTML features enabled by GHS is that a plugin that supports a specific HTML feature provides a complete user experience for that feature, whereas GHS ensures only that such a content is accepted by the editor.įor instance, the dedicated bold feature offers a toolbar button used to make the selected text bold. Read more about it in the Level of support section. Such content can also be edited in the editor, although, to a limited extent. via editor.getData()), and are visible in the editing area. The enabled HTML features can be loaded (e.g. Plugin developers will also need to set allowedContent properties which tell the editor what kind of content a feature allows in. When configuring CKEditor 4 you will be mostly interested in setting the allowedContent and disallowedContent options. Some of the attributes on existing dedicated CKEditor 5 features: Allowed Content Rules define which HTML elements, attributes, styles, and classes are allowed.Here are some examples of HTML features that can be easily enabled using General HTML Support: Visit the full-featured editor example to see more in action. That is, actually, what I've been trying to achieve, but using other browsers.This demo only presents a limited set of features. Here is how you can allow any content in the editor: config.allowedContent.
#CKEDITOR ALLOWEDCONTENT MANUAL#
Interestingly, though, if you paste with the keyboard (ctrl-v) in Internet Explorer, all additional formatting is stripped out - ie, you get the same functionality as if you had clicked the Paste as Plain Text button. It is possible to manually specify allowed tags or properties through To do this right, it is recommended you get familiar with. If some manual tells you to edit CKEditors configuration, just edit config.js file. If you change the toolbar on the text area to be, say, the Basic toolbar, then the content is pasted in correctly - WITHOUT any of the superflous formatting!īut that defeats the purpose of content editors being able to apply specific styling to content they create by using the toolbar buttons.
#CKEDITOR ALLOWEDCONTENT FULL#
eg, if the toolbar set for the editable text area where you are pasting (ie, ctrl-v on a PC keyboard) is either the standard or full toolbar, then content coming from Word where there are different fonts, sizes, colours, or tables etc remain in the pasted content. Removing the config.allowedContent = true setting altogether from config.js works as expected HOWEVER it only applies to formatting relating to buttons available on the specific WYSIWYG area. However reading those articles through carefully, can see now how that is used. I had previously experimented by setting config.allowedContent to false, which made no difference.
