#13014 closed Bug (invalid)
Bug: CKEDITOR init default Content
Reported by: | TeckniX | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
It seems impossible to disable the stupid 'init' of CKEDITOR, so that any HTML within the editable area is retained.
Problem: Impossible to create starting HTML for CKEDITOR instance. HTML within editable content removed during instance init
Current behavior: While creating a simple DIV set as editable, default HTML of <p><br></p> gets added. If the user has default html such as <p><span></span></p>, it is replaced by the above
Expected behavior: The HTML added to the DIV set as editable is NOT modified and retained.
See Fiddle: http://jsfiddle.net/emjmu2pv/1/
If a simple is added between the span, then the HTML is retained and a <br type="_moz"> is added onFocus??!? (wasn't this bug fixed ages ago)
Change History (5)
comment:1 Changed 10 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Version: | 4.4.7 |
comment:2 Changed 10 years ago by
Thank you for the detailed explanation and the SO link which explains how I can make this work properly.
comment:3 Changed 10 years ago by
Looking into the push functionality, it seems to add 'protected' data that cannot be edited by the user. What I want is for the 'HTML' that I pass to be the default editor content.
Essentially it's almost as-if I wanted to replace the default <br type=_moz> that you put in, and replace it with my pre-defined HTML. Is this possible??
comment:4 Changed 10 years ago by
Looking into the push functionality, it seems to add 'protected' data that cannot be edited by the user.
That is the idea of protected source. User can’t accidentally or purposely delete/modify protected elements unless he switches to Source mode and do it there.
Essentially it's almost as-if I wanted to replace the default <br type=_moz> that you put in, and replace it with my pre-defined HTML. Is this possible??
No, you can't use any HTML you like. CKEditor uses set of its rules (plus HTML specification rules) in order to provide stable editing environment. You have to comply with these rules.
comment:5 Changed 10 years ago by
Please also note that I wrote "there many valid answers there". You don't have to use protected source (which makes the element invisible).
As for the rest - j.swiderski is absolutely right. CKEditor has a huge number of options, but still some things cannot be configured. Of course, they can be changed, because this is all open source, but sometimes that change may require rewriting half of the editor ;).
There are two reasons why HTML is changed:
In any case - all these are expected behaviours. And
<br type=_moz>
is not a bug too - it's crucial for making the content editable.