CKEditor removing <html> and <body> tags

Viewed 17484

I using CKEditor, and if I click the Source button and paste HTML code like below :

<html>
<head>
<meta http-equiv="Content-Type" content="text/html" />
</head>
<body>
<p>test</p>
</body>
</html>

and click to Source again and then submit the form, the html , head and , body tags are removed and just stays <p>test</p>!

CKEditor configuration:

CKEDITOR.replace('content', {
            extraPlugins: 'font,panelbutton,colorbutton,colordialog,justify,indentblock,aparat,buyLink',
            autoGrow_onStartup: true,
            enterMode: CKEDITOR.ENTER_BR,
            FullPage : false,
            allowedContent : true,
            ProtectedTags : 'html|head|body'
        });

Can you help me?

2 Answers

Just add this code to prevent editor to remove 'HEAD/BODY/HTML' tags from your source code:-

CKEDITOR.replace( 'editor1', {              
    fullPage: true,
    allowedContent: true,
    autoGrow_onStartup: true,
    enterMode: CKEDITOR.ENTER_BR
});
Related