New issue
Advanced search Search tips

Issue 742896 link

Starred by 3 users

Issue metadata

Status: Available
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 3
Type: Bug



Sign in to add a comment

contenteditable replaces strong tag to bold when its content become empty

Reported by m.sam...@cksource.com, Jul 14 2017

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36

Steps to reproduce the problem:
I made also example code here: https://codepen.io/msamsel/pen/bRZeGO

1. Open code
2. There is <strong> element and editable div
3. Start to delete characters.
4. You need to make div empty, so there will be no characters inside editable.
5. Now start to type again.
6. Text get different HTML tags <b> instead of <strong>

Similar situation happen to custom elements: https://codepen.io/msamsel/pen/VWRaPj
After removing it, new text is surround with spans and fonts with css markups.

What is the expected behavior?
I expect that editable text will preserve proper html tag when text will be deleted and user start to type again.

What went wrong?
There appear text surrounded with `<b>` tag not the `<strong>`

Did this work before? N/A 

Does this work in other browsers? No
 I was able to reproduce problem on Safari (MacOS).

Problem doesn't exist on IE10, IE11, Edge and Firefox

Chrome version: 59.0.3071.115  Channel: stable
OS Version: OS X 10.12.5
Flash Version:
 
contenteditable.html
605 bytes View Download
Labels: Needs-Triage-M59 Needs-Bisect OS-Windows
I'm able to reproduce this issue on Chrome Beta#60.0.3112.66 for 'Win7' as well.

Thank you!
Labels: -Needs-Bisect M-61 OS-Linux
Status: Untriaged (was: Unconfirmed)
Able to reproduce the issue using #59.0.3071.115 on Mac 10.12.5, Win 10, Linux Ubuntu 14.04 as well. Observed the text surrounded with `<b>` instead of <strong>

Observing the same behavior since M45. Hence considering this issue as Non-Regression issue and untriaging to get input's from dev.

Note:
1. Same behavior is seen in M61 as well.
2. Removing Bisect label as this is a Non-Regression issue.

Thanks!!

Summary: contenteditable replaces strong tag to bold when its content become empty (was: contenteditable replace tags when div became empty)
Labels: Hotlist-Interop
Status: Available (was: Untriaged)
I would like to point out that problem doesn't only concern b and strong tags. In fact there are many cases where such conversion occurs. You just need to apply same steps to different tags: 
* var gets converted to i
* samp, tt, code get converted to font
* del gets converted to strike.
* and so on...

Comment 7 by yosin@chromium.org, Jan 10 2018

Labels: Pri-3

Sign in to add a comment