inserthtml command breaks some inline tags into two

RESOLVED INVALID

Status

()

Core
Editor
RESOLVED INVALID
10 years ago
10 years ago

People

(Reporter: Martin Kou, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b5) Gecko/2008032619 Firefox/3.0b5
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9b5) Gecko/2008032619 Firefox/3.0b5

When the inserthtml command is executed while the caret is inside certain inline tags (e.g. <strong> and <code>), the inline tag is split up into two parts. And the inserted HTML would be in between the two parts, losing the styles given by the inline tag.

Reproducible: Always

Steps to Reproduce:
1. Place the caret inside an inline tag. (<strong>, <code>, <em> etc., <a> doesn't have the problem, strangely.)
2. Run document.execCommand('inserthtml', false, 'e') in the editable area.
Actual Results:  
The 'e' inserted isn't bold, and the <strong> tag in the HTML code is split into two parts.

Expected Results:  
The 'e' should be inserted into the <strong> tag without splitting the tag into two parts.

This bug is causing the bug https://dev.fckeditor.net/ticket/2177 in FCKeditor.
(Reporter)

Comment 1

10 years ago
Created attachment 319741 [details]
Test case with an editable iframe prepared.
just a quick comment, change the summary to innerHTML, cause thats the name of the property youre looking for and it would make it easier to find!
scratch that misread youre file

:(
fwiw Chrome does the same, gonna check opera later tonight.
Whiteboard: [invalid?]
... and so does Opera.

->INVALID
Status: UNCONFIRMED → RESOLVED
Last Resolved: 10 years ago
Resolution: --- → INVALID
Whiteboard: [invalid?]
You need to log in before you can comment on or make changes to this bug.