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

Copying text into first paragraph causes blank Paragraph Block to appear above text #7973

Closed
maddisondesigns opened this issue Jul 16, 2018 · 5 comments
Labels
[Feature] Raw Handling Related to the ability to convert content to blocks, paste handling, etc [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Enhancement A suggestion for improvement.

Comments

@maddisondesigns
Copy link

Describe the bug
I created a new page and pasted some (unformatted) text content into the first Paragraph block after the title. Instead of actually pasting the text into the Paragraph Block though, it created a whole new Paragraph Block and pasted the text into that instead, leaving me with a blank Paragraph Block.

gutenberg_copytextcreatedemptyparagraph

To Reproduce
Steps to reproduce the behavior:

  1. Copy some unformatted text from somewhere
  2. Create new Page
  3. Type Page title in Title Block
  4. Put cursor in first Paragraph Block
  5. Hit Ctrl-V/Cmd+V to Paste text
  6. A new Paragrph Block is created and the text appears in this block instead of the Block where you tried to paste it

Expected behavior
When I paste plain text into a Paragraph Block, it should paste into the Block where my cursor is, not create a brand new Block, leaving me with an empty Block.

macOS Sierra 10.12.6 (16G1510)
Firefox Quantum 61.0.1 (64-bit)
Gutenberg 3.2.0

@ZebulanStanphill
Copy link
Member

ZebulanStanphill commented Jul 16, 2018

I have confirmed this is happening in master right now.

@designsimply designsimply added [Type] Bug An existing feature does not function as intended [Feature] Raw Handling Related to the ability to convert content to blocks, paste handling, etc labels Jul 17, 2018
@designsimply
Copy link
Member

Tested and confirmed that an empty paragraph block remains after I copy text from elsewhere that contains leading line breaks. I found that I was able to copy some text over without that happening if I only select a portion of text that does not include the beginning of a line.

Video: 1m21s
Seen at http://alittletestblog.com/wp-admin/post.php?post=13996&action=edit running WordPress 4.9.7 and Gutenberg 3.2.0 using Firefox 61.0.1 on macOS 10.13.5.

screen shot 2018-07-17 at tue jul 17 10 13 20 am

@ghost
Copy link

ghost commented Jul 23, 2018

I copied text from pdf but when I switched to the classic editor, there were double spacing (&npsb;) after each paragraph. This is awful for a document of 1500 words.

@designsimply
Copy link
Member

designsimply commented Jul 24, 2018

@matto15 in your case it sounds like whatever was used to create the pdf had some special formatting to hide double spacing ( ), and if the underlying code had empty paragraphs included as double spacing, it makes sense for an editor to honor that. I would be interested to learn more about what was used to create that pdf (if you know) or to look at it directly (if it can be shared), and if you're interested in talking about it more too, please add a new post at https://wordpress.org/support/plugin/gutenberg/

@designsimply designsimply added [Type] Enhancement A suggestion for improvement. and removed [Type] Bug An existing feature does not function as intended labels Jul 27, 2018
@designsimply
Copy link
Member

designsimply commented Aug 7, 2018

Closing this so we can consolidate in #7616 which addresses the underlying problem here which is that when you paste content with leading white space, such as a line break, it results in an empty block that shouldn't be there.

@designsimply designsimply added the [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed label Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Raw Handling Related to the ability to convert content to blocks, paste handling, etc [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

3 participants