Opened 13 years ago
Closed 12 years ago
#8722 closed Bug (fixed)
[FF, Webkit]: ForeAsPlainText splits span tags
Reported by: | Jakub Ś | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.5 |
Keywords: | Firefox, Webkit | Cc: |
Description
To reproduce:
- Paste the below code in CKEditor
<span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">This is </span></span>
- Paste the below code into console or use PasteAsPlainText plugin
CKEDITOR.instances.editor1.insertText("Hello, world");
- Put cursor here:
Th^is is
- Execute console command or use PasteAsPlainText plugin.
Results:
Firefox and Chrome split each section in separate spans whereas IE and Opera do the expected and join all together. Safari drops formatting.
IE and Opera OK-
<p> <span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">ThHellois is </span></span></p>
Firefox -
<p> <span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">Th</span></span><span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">Hello, world</span></span><span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">is is </span></span></p>
Chrome -
<p> <span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">Th</span></span><span style="font-family: arial, helvetica, sans-serif; ">Hello, world</span><span style="font-family: arial, helvetica, sans-serif; ">is is</span></p>
Note also that Chrome drops font-size if it is default 12px. If you use font-size E.g 13 you will get spans like: <span style="font-family: arial, helvetica, sans-serif; font-size: 13px;">
Safari -
<p> <span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">Th</span></span>Hello, worldis is</p>
All issues have been reproducible from CKEditor 3.5. Before this version text was pasted without any formatting. From 3.5 there is an improvement but there is still something missing.
Exception is the Safari where it seems that this particular part was working till CKE 3.4.3 and was broken in CKE 3.5.
Change History (2)
comment:1 Changed 13 years ago by
Status: | new → confirmed |
---|
comment:2 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
This is no longer an issue in latest CKEditor 4.1.2. I haven't observed such splitting in any browser.
Please note that if in any case you get some sort of splitting when pasting pure text you might want to check http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-clipboard_defaultContentType and set it to text.