Ticket #8657 (closed Bug: invalid)

Opened 3 years ago

Last modified 2 years ago

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

comment:1 Changed 3 years ago by adsharp

  • Cc adam.sharp@… added

comment:2 Changed 2 years ago by j.swiderski

  • Status changed from new to closed
  • Resolution set to invalid

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 – 2012 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy