Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste: Single-line pastes should conform to current block #6555

Closed
mcsf opened this issue May 3, 2018 · 6 comments · Fixed by #10614
Closed

Paste: Single-line pastes should conform to current block #6555

mcsf opened this issue May 3, 2018 · 6 comments · Fixed by #10614
Assignees
Labels
[Block] List Affects the List Block [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Priority] High Used to indicate top priority items that need quick attention [Type] Enhancement A suggestion for improvement.

Comments

@mcsf
Copy link
Contributor

mcsf commented May 3, 2018

Issue Overview

A revisit of #5354. Per the last comment, this is the behavior we'd like to achieve when copying (a) list item(s) from a rich-text source:

  • If you are on an empty paragraph, respect the source [and create a new list block, for instance].
  • Otherwise, if you copied more than one line, respect the source [and create a new list block, for instance].
  • Otherwise, if you copy a single line, paste as plain text [and merely add to the current paragraph].

The last point is where behavior differs: currently, pasting will always create a new block (for a list, etc.) unless the clipboard only contains pure text.

@ellatrix
Copy link
Member

ellatrix commented May 3, 2018

Sure. So how do we determine that something is a single line?

<ul><li>If you are on an empty paragraph, respect the source [and create a new list block, for instance].</li></ul>
<pre><code>A huge chunk of code</code></pre>

We'll have to specifically target some kind of blocks?

@mcsf
Copy link
Contributor Author

mcsf commented May 4, 2018

@iseulde: we would probably start small and focus on lists first, as they are the kind of content that sparked this discussion.

@mcsf mcsf added the [Type] Enhancement A suggestion for improvement. label May 4, 2018
@mtias
Copy link
Member

mtias commented Jun 22, 2018

We could try a char-length cutout as well.

@mtias mtias added the [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... label Jun 22, 2018
@mcsf
Copy link
Contributor Author

mcsf commented Jul 9, 2018

@mtias, can you elaborate?

@mtias
Copy link
Member

mtias commented Jul 9, 2018

If the source has less than x length, we treat it as plain text.

@mtias mtias added this to the WordPress 5.0 milestone Oct 3, 2018
@mtias mtias added the [Priority] High Used to indicate top priority items that need quick attention label Oct 3, 2018
@ellatrix ellatrix self-assigned this Oct 12, 2018
@ellatrix
Copy link
Member

PR coming up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] List Affects the List Block [Feature] Paste [Feature] Writing Flow Block selection, navigation, splitting, merging, deletion... [Priority] High Used to indicate top priority items that need quick attention [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants