0
votes

I'm in the middle of re-writing a cms, it uses custom tags to bring in info from various modules. Example:

{htmlHead} - Would contain opening html tag, head, css, javascript etc.

In CKeditor, I would use the tag like this:

{htmlHead}
    <body>
        <p>body</p>
    </body>
</html>

If I swap between source and html mode, the go back to source mode, it puts {htmlHead} in the body and adds in additional html like this:

<html>
    <head>    
        <title></title>
    </head>
    <body>{htmlHead}
        <p>body</p>
    </body>
</html>

Is there a way to tell ckeditor to not change any text or filter anything in the input?

I have already added the following config options that would effect the filtered data:

config.templates_replaceContent = false;
config.protectedSource = '[/\r|\n/g]';
config.allowedContent = true;

According to the docs, allowedContent doesn't filter any of the content when set to true, so I'm not sure why it would be changing the head still.

Any thoughts?

1

1 Answers

0
votes

You're using CKEditor incorrectly. It requires you to load valid HTML. When you replace entire HTML document head with some placeholder the document is no longer valid. Read more in the Basic CKEditor concepts.