Bug 223689 - [GTK] After multiline paste into LI cannot add new LI using Enter
Summary: [GTK] After multiline paste into LI cannot add new LI using Enter
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-24 06:51 PDT by Milan Crha
Modified: 2021-03-24 07:26 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.