Status: Unconfirmed
Owner: ----
Labels: Arch-x86_64 Hotlist-Interop Via-Wizard-API
Components: Blink>Editing
OS: Windows
Pri: 2
Type: Bug
New issue 961751 by
brett...@gmail.com: Extra newline added to text containing html tags inserted into a contentEditable element with display: inline-block
https://bugs.chromium.org/p/chromium/issues/detail?id=961751UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36
Steps to reproduce the problem:
The attached file automatically does all steps.
It also repeats the test on different element (all with the same text), only changing the element display and enclosing html tags around the inserted text.
1. Create a div element
2. Set the element contentEditable attribute to "true"
3. Set the element style to "display: inline-block"
4. Enter text into the element
5. Set text caret to somewhere inside the element, not at start or end.
6. Run JavaScript: "document.execCommand('insertHTML', false, '<b>NEW TEXT</b>')"
OR
6. Paste text into element (If the clipboard has similar text/html data in it)
What is the expected behavior?
New text is inserted, without affecting the whitespace around the inserted text
What went wrong?
New text and html tags are inserted, and an extra newline is added after the inserted text.
Did this work before? N/A
Does this work in other browsers? Yes
Chrome version: 74.0.3729.131 Channel: stable
OS Version: 10.0
Flash Version:
This happens both when pasting, or using "document.execCommand('insertHTML')".
It only happens when the contentEditable element is "display: inline-block", and the inserted text has html tags in it.
If the text caret is at the start or end of the element, then a newline is not added.
If there is text selected, then a newline is not added.
This works without issue in Firefox, no extra newline is added.
Attachments:
insertHTML-newline-test.html 1.2 KB
--
You received this message because:
1. A rule CC'd you on the issue
2. You are auto-CC'd on all issues in component Blink>Editing
You may adjust your notification preferences at:
https://bugs.chromium.org/hosting/settingsReply to this email to add a comment or make updates.