WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.35k stars 4.13k forks source link

Improve pasting paragraphs of text #1524

Closed jwold closed 7 years ago

jwold commented 7 years ago

When you paste in multiple paragraphs of text it would be great if the text block could remember the paragraph breaks.

What's happening right now:

Ideal state

Note: One other way would be that pasting multiple paragraphs creates multiple text blocks, but I don't think that's ideal. It's easy to break a paragraph out anyway by pressing enter twice.

Annotation:

annotation

youknowriad commented 7 years ago

Seems like a duplicate to #1442 and the work being done in #1331. Closing, feel free to reopen if there's any subtility I missed.

Also, It would be great if you can check for existing issues and PRs before opening issues. It'd help triage work.

jwold commented 7 years ago

@youknowriad, thanks for the help triaging this and the other ticket! I'll be more diligent about checking tickets.

@iseulde and @jasmussen I read through #1331 and am still not sure if this feature is covered.

If I paste in multiple paragraphs of text from another source will the #1331 PR create line breaks between each or bunch them up?

youknowriad commented 7 years ago

@jwold The idea is that pasting will convert the text to blocks, so multiple paragraphs of text will create multiple text blocks which is the right thing to do IMO.

jwold commented 7 years ago

Had a discussion on Core-Editor about this. I'm personally ok either way with creating multiple text blocks or keeping it in one text block but adding paragraph breaks. The argument for keeping in one text block is you're adding context for where you're pasting text.

Example:

I start writing an article and add some text and an image, I then paste in a few paragraphs of text into one text block, add some more, etc. If I need to break out the text into multiple text blocks again it's really easy to just press enter twice on each one.

youknowriad commented 7 years ago

Note that the text block doesn't support multiple paragraphs, it's just br. We already explored a multi-paragraph text block before but we decided to leave this for the classic block only.

jasmussen commented 7 years ago

Note that the text block doesn't support multiple paragraphs, it's just br. We already explored a multi-paragraph text block before but we decided to leave this for the classic block only.

That's the thing though, you can actually force paragraphs in there, which you shouldn't be able to:

jun-28-2017 16-17-18

This is a textexpander in action. But pasting multiple paragraphs in a single block does the same.

I agree that ideally pasting multiple paragraphs like this would create multiple paragraph blocks. But I'd also be okay with collapsing the ps into brs, since typographically those are still paragraphs, they are just zero margin paragraphs. But yes, the former would be ideal.

Alternately, if we detect you pasting multiple paragraphs, or textexpanding, we could convert it to "classic text".

ellatrix commented 7 years ago

There's a PR for this waiting, which converts it all to text blocks... #1331.