CKEditor 4 Documentation

Output

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?

If you want CKEditor 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 SDK.

If, for example, you want CKEditor 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?

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

CKEditor content created in BBCode