Contribute to this guideReport an issue


The following article contains tips about customizing the output HTML code produced by the editor.

# How Do I Output HTML Instead of XHTML Code Using CKEditor 4?

If you want CKEditor 4 to output valid HTML4 code instead of XHTML, you should configure the behavior of the dataProcessor.

For some tips on how to achieve this, check the HTML Output Formatting article as well as the HTML Output Formatting sample in CKEditor 4 Examples.

If, for example, you want CKEditor 4 to output the self-closing tags in the HTML4 way, creating <br> elements instead of <br/>, configure the selfClosingEnd setting in the following way.

CKEDITOR.on( 'instanceReady', function( ev ) {
    ev.editor.dataProcessor.writer.selfClosingEnd = '>';

# How Do I Output BBCode Instead of HTML Code Using CKEditor 4?

You should try the BBCode plugin. See the BBCode Editing sample and the documentation for more information.

CKEditor content created in BBCode