#12667 closed Bug (invalid)
allowedContent = true has no effect
Reported by: | poztin | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description ¶
I'm trying to turn off the Advanced Content Filter as described in these two guides:
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
However this has no effect.
As an example:
editor.setData('<<--txtAddress1-->><BR><<--txtAddress2-->><BR>');
Results in the html being reformatted to:
<p><<--txtAddress1-->><br /> <<--txtAddress2-->></p>
I do not want any reformatting whatsoever.
I have tried:
var editor = CKEDITOR.replace('oEdit1', { allowedContent: true, ...
CKEDITOR.editorConfig = function( config ) { config.allowedContent = true;
and also the following outside of the config declaration:
CKEDITOR.config.allowedContent = true;
None of them make any difference. I have also tried clearing the cache.
Tested in all browsers including Chrome, IE, Firefox and Safari.
Change History (3)
comment:1 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Version: | 4.4.5 |
comment:2 Changed 10 years ago by
I'm not sure this addresses the problem.
We are loading markup from a database and due to backwards compatibility we need it to be persisted in its original format.
The example given is just a simple scenario, your proposed solution will not be sufficient for all cases.
All documentation surrounding the allowedContent property suggests that this automatic reformatting mechanism can be turned off, which doesn't seem to be the case.
comment:3 Changed 10 years ago by
All documentation surrounding the allowedContent property suggests that this automatic reformatting mechanism can be turned off, which doesn't seem to be the case.
Reformatting with ACF is one thing but there are still HTML rules that CKEditor needs to follow and this can't be turned off.
Please remember that CKEditor is HTML editor and not any text editor. Please remember there are rules defined in HTML specification that can't be broken. While this case looks fixable, there might be other ones that are not thus please be careful when playing with custom code.
Now your case; whenever you press Enter key, new line is inserted. In CKEditor this line is represented by P, BR or DIV. By default CKEditor used P mode and wraps any 'free' text in paragraphs.
In your particular case Enter mode BR is missing in editor configuration - http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-enterMode. Please note however that with this setting BRs will be inserted on every enter key pressed.