Opened 12 years ago

Closed 12 years ago

#8657 closed Bug (invalid)

Using insertHtml within a formatted span tag splits it into two and inserted HTML doesn't get formatted

Reported by: adsharp Owned by:
Priority: Normal Milestone:
Component: General Version: 3.6.2
Keywords: Cc: adam.sharp@…

Description

Browser: Safari, Firefox OS: Max OS X 10.7.2

To reproduce:

  1. Start with an empty CKEditor instance
  2. Type in some text
  3. Format the text as Arial 12px
  4. Move the cursor somewhere in the middle
  5. Call CKEditor.instances.editor.insertHtml("<b>Hello, world</b>")

Result:

<span style="font-size: 12px;"><span style="font-family: arial,helvetica,sans-serif;">This is </span></span>
<b>Hello, world</b> <!-- span was split in two and this inserted between -->
<span style="font-size:12px;"><span style="font-family: arial,helvetica,sans-serif;"> some text</span></span>

Change History (2)

comment:1 Changed 12 years ago by adsharp

Cc: adam.sharp@… added

comment:2 Changed 12 years ago by Jakub Ś

Resolution: invalid
Status: newclosed

This is how insertHTML works. I CKEditor had modified inserted HTML that would be a real bug.

For that you should rather use PasteAsPlainText plugin or CKEDITOR.instances.editor1.insertText("Hello, world");

There is a little problem with this option however - I have reported it here #8722.

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy