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 and pasting lists adds empty list items #6621

Closed
grappler opened this issue May 7, 2018 · 3 comments
Closed

Copying and pasting lists adds empty list items #6621

grappler opened this issue May 7, 2018 · 3 comments
Labels
[Block] List Affects the List Block [Feature] Paste [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended

Comments

@grappler
Copy link
Member

grappler commented May 7, 2018

Issue Overview

I have been copying text from Word to Gutenberg 2.8.

After copying and pasting the content in a list block it looks like this:
image

In the code editor the content looks like follows.

<!-- wp:list -->
<ul>
	<li>Bauherrschaft: privat Gebäudeart: Ersatzneubau in Holz- </li>
	<li>Elementbauweise Realisierung: 2006 - 2007</li>
	<li>
		Verantwortliche Mitarbeit: Marcel, Enis<br/> </li>
	<li>Fotografen: Heinrich + Roland, Zürich
	</li>
	<li>Leistungsumfang Kosten- und Terminplanung</li>
</ul>
<!-- /wp:list -->

Even after removing the empty spaces in the list, they return once I saved the post.

Expected Behavior

I would expect that I could copy and paste text without it adding the extra spaces and <br> tags.

Possible Solution

Strip the spaces within the <li> tags.

@karmatosed karmatosed added the [Type] Bug An existing feature does not function as intended label May 10, 2018
@tofumatt
Copy link
Member

Just to make sure we can reproduce this bug, which version of Word were you using? Operating system info would be great too 😄

@danielbachhuber danielbachhuber added this to the WordPress 5.0 milestone Jun 4, 2018
@grappler
Copy link
Member Author

grappler commented Jun 7, 2018

I was opening a docx file in Pages on OSX. Now looking more into it the issues seems to be caused by a line breaker U+2028.

To test it you need some content like this.
image

  • Copy the text and paste it with the option "Paste and match style".
  • Convert the paragraph block to a list.
  • Click in within the paragraph and move each item on it's own line.
  • Save the post
  • Refresh the page and see the issue.

It seems to work ok on Windows 10 with Word 2016.

@designsimply designsimply added [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Block] List Affects the List Block labels Oct 16, 2018
@designsimply
Copy link
Member

Thank you for reporting this and for testing Gutenberg! I am closing this issue as a duplicate of #5727 and this issue will be linked there for reference.

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 [Status] Duplicate Used to indicate that a current issue matches an existing one and can be closed [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

6 participants