Opened 15 years ago
Closed 14 years ago
#5367 closed New Feature (fixed)
Implement editor.insertText and use it in the special chars dialog
Reported by: | Frederico Caldeira Knabben | Owned by: | Garry Yao |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.5 |
Component: | General | Version: | SVN (CKEditor) - OLD |
Keywords: | Cc: |
Description
We must have an insertText function which inserts plain text into the editor, contextual to the current selection.
This ticket is being opened because of [5273]. It fixes the undesired behavior we have in the insert special char dialog because of the usage of insertHtml. We should revert those changes and use the new insertText function instead.
Attachments (4)
Change History (18)
comment:1 Changed 15 years ago by
comment:2 Changed 15 years ago by
Milestone: | CKEditor 3.4 → CKEditor 3.5 |
---|
comment:3 Changed 14 years ago by
Milestone: | CKEditor 3.4.1 → CKEditor 3.5 |
---|
comment:4 Changed 14 years ago by
Milestone: | CKEditor 3.5 → CKEditor 3.6 |
---|
Defer as #5309 is not in 3.5.
comment:5 Changed 14 years ago by
Milestone: | CKEditor 3.6 → CKEditor 3.5 |
---|
Move this back to 3.5 as it could be implemented as a separately thing and helps to work around issues like #4746.
Changed 14 years ago by
Attachment: | 5367.patch added |
---|
comment:6 Changed 14 years ago by
Owner: | set to Garry Yao |
---|---|
Status: | confirmed → review |
comment:7 Changed 14 years ago by
It doesn't remove a selection content when used with CKEDITOR.editor#insertText. Although the Special Chars dialog removes such content.
Is this a correct behavior?
comment:8 Changed 14 years ago by
Status: | review → review_failed |
---|
Changed 14 years ago by
Attachment: | 5367_2.patch added |
---|
comment:9 Changed 14 years ago by
Status: | review_failed → review |
---|
Changed 14 years ago by
Attachment: | 5367_3.patch added |
---|
comment:10 Changed 14 years ago by
New patch changes a bit the original way of handling line-breaks in plain text, the major problem for the original way of using enterKey was performance penalty.
comment:11 Changed 14 years ago by
Status: | review → review_failed |
---|
It works fine in FF and IE, although in Webkit (Chrome) i've got an extra paragraph and the inline style if not preserved.
Steps
- Use such content with the selection:
<p> This is some <strong>sample [text</strong>. You are using <a href="http://ckeditor.com/">CKEditor</a>.]</p>
- Execute the command:
CKEDITOR.instances.editor1.insertText('foo\nbar');
Result:
<p> This is some <strong>sample </strong>foo</p> <p> bar</p>
comment:12 Changed 14 years ago by
Status: | review_failed → review |
---|
- Extra paragraph issue: this's actually a regression from [5728], addressed in new patch;
- No inline style issue: this been a webkit bug instead, but only happens with text with multiple lines, so we'd probably have to go the same way with Gecko because of this.
Changed 14 years ago by
Attachment: | 5367_4.patch added |
---|
comment:13 Changed 14 years ago by
Status: | review → review_passed |
---|
It works fine now, although i had some issues when applying the patch on the newest revision.
comment:14 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | review_passed → closed |
We'll be working on this at #5309.