Bug 12318 - Paste of lines of plain text always surrounds in <div> tags, no other options
Summary: Paste of lines of plain text always surrounds in <div> tags, no other options
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-01-18 12:00 PST by Dan Wood
Modified: 2012-05-21 20:17 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dan Wood 2007-01-18 12:00:04 PST
To reproduce:

0. Launch Blot_editableDiv_showSource, my modified version of "Blot" available from <http://dan.karelia.com/webkit/Blot_editableDiv_showSource.zip> with DYLD_FRAMEWORK_PATH pointing to TOT.  (I'm using r18941)

1. Copy out some plain text (not attributed text) from a plain text editor with several lines, e.g.

this is line one
this is line two
this is line three

2. Click in the top panel
3. Paste

Results: The HTML of the editable div contains:
<div>this is line one</div><div>this is line two</div><div>this is line three</div>

Expected: I need to have the ability to indicate whether the text is to be marked up like that, or to be lines separated by <br />, or enclosed in <p> tags -- We need to have some way to have that option in the HTML that is generated.
Comment 1 Justin Garcia 2007-03-06 22:21:46 PST
Dan, we recently exposed -[WebHTMLView _documentFragmentFromPasteboard:forType:inContext:subresources].  You could override paste and do your own fragment creation in the plain text case.
Comment 2 Ryosuke Niwa 2012-05-21 20:17:38 PDT
Now we have DefaultParagraphSeparator command which lets you switch the default block element between div and p.