Bug 223689

Summary: [GTK] After multiline paste into LI cannot add new LI using Enter
Product: WebKit Reporter: Milan Crha <mcrha>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: nekohayo, wenson_hsieh
Priority: P2    
Version: Other   
Hardware: Unspecified   
OS: Unspecified   

Description Milan Crha 2021-03-24 06:51:22 PDT
Usual editing of an OL/UL adds a new LI whe the Enter key is pressed, as expected. When there's pasted multiline (multiparagraph) text into the LI, the enter will add the paragraph, instead of the LI. This is with WebKitGTK 2.30.5.

Steps:
a) create /tmp/a.html with this content:

<html><body>
<div>text before</div>
<ul><li>l1</li>
<li><div>l2 with div</div></li>
<li>l3</li>
</ul>
<div>div1</div>
<div>div2</div>
<div>div3</div>
</body></html>

b) call: MiniBrowser --editor-mode /tmp/a.html
c) pressing Enter in "l1" adds a new LI - as expected
d) pressing Enter in "l2 with div" adds a new DIV - not expected, it may split the text and add a new LI

You may claim it's a crafted code, but it can happen easily:

e) select "div1 div2" text
f) Ctrl+C to copy it
g) go to the end of the "l3" line end press Enter to create a new bullet point
h) paste (Shift+Ins)

The "div1 div2" is as two lines in a single bullet. Pressing Enter anywhere in this bullet will not create a new LI, it creates a new DIV inside that LI.