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

Text Block: You can paste multiple paragraphs in #1294

Closed
jasmussen opened this issue Jun 20, 2017 · 6 comments
Closed

Text Block: You can paste multiple paragraphs in #1294

jasmussen opened this issue Jun 20, 2017 · 6 comments
Assignees
Labels
[Type] Bug An existing feature does not function as intended

Comments

@jasmussen
Copy link
Contributor

As reported in #1291 (comment), with screenshot https://cl.ly/011C0a450G2P, you can copy and paste arbitrary content into the basic text block.

Since it's only for single paragraphs, this appears to be a bug.

Possibly related to #495

@jasmussen jasmussen added the [Type] Bug An existing feature does not function as intended label Jun 20, 2017
@ellatrix ellatrix self-assigned this Jun 20, 2017
@aduth
Copy link
Member

aduth commented Jun 20, 2017

Can you clarify if this is for the freeform block or the text block? Seems to be the latter.

@jasmussen
Copy link
Contributor Author

Nope, this is for the plain Text block. Here it is with textexpanded text:

screen shot 2017-06-20 at 16 46 56

Here's the freeform block:

screen shot 2017-06-20 at 16 47 15

@ellatrix
Copy link
Member

First, we'll need this for sure: #1331.

So then there are a few option for this one:

  • We build it in the parser. Pasted content is parsed, and it is all inserted correctly as text blocks (paragraphs). 😃
  • We build it in the parser, but only for pasted content. This means that parser for pasted content will do an extra effort to convert legacy (and pasted) content. 😃
  • We paste it as inline content. 🙁
  • We create a freeform block. ☹️

My favourites are one and two. :) See also #1133. cc @dmsnell

@dmsnell
Copy link
Member

dmsnell commented Jun 21, 2017

intercepting the paste is something I think we'll have to be aware of for all block types. what does it mean to paste formatted text into the embed URL input?

in this case, we could parse it as HTML with JS then split by top-level p tags and create separate blocks for each one

@ellatrix
Copy link
Member

Yeah, so we'd prefer to go for parsing paste content only (second option)? Sounds good to me too.

intercepting the paste is something I think we'll have to be aware of for all block types. what does it mean to paste formatted text into the embed URL input?

In #1331, if the block does not have an onSplit prop, it will be pasted as inline content. So if you pasted paragraphs in a button, it will all be just text.

@ellatrix ellatrix changed the title Freeform Block: You can paste multiple paragraphs in Text Block: You can paste multiple paragraphs in Jun 21, 2017
@ellatrix
Copy link
Member

ellatrix commented Jul 5, 2017

Fixed in #1331.

@ellatrix ellatrix closed this as completed Jul 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

4 participants