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

Try transform multiple blocks to a quote #7069

Merged
merged 2 commits into from Jun 19, 2018

Conversation

Projects
None yet
4 participants
@Rahmon
Contributor

Rahmon commented May 31, 2018

Description

Try transform multiple blocks to a quote

Closes #7045

How has this been tested?

This has been tested with "npm test" and manually on Chrome

Types of changes

Bug fix

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • [] My code has proper inline documentation.
@jorgefilipecosta

This comment has been minimized.

Member

jorgefilipecosta commented Jun 5, 2018

I noticed a bug. If we create some paragraphs then convert to quote, and then covert to paragraph again, the paragraphs become empty.
Changing the create block to:

return createBlock( 'core/quote', {
						value: hasItems ?
							items.map( ( content, index ) => ( { children: <p key={ index }>{ content }</p> } ) ) :
							[],
					} );

Seems to seems to fix the problem.

@Rahmon

This comment has been minimized.

Contributor

Rahmon commented Jun 6, 2018

I updated the PR.Thank you @jorgefilipecosta .

@mcsf

mcsf approved these changes Jun 11, 2018

Thanks for your contribution, @Rahmon!

@gziolo gziolo added this to the 3.1 milestone Jun 19, 2018

@gziolo gziolo merged commit a40ba57 into WordPress:master Jun 19, 2018

2 checks passed

codecov/project 46.63% (+0.32%) compared to 802f890
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Rahmon Rahmon deleted the Rahmon:try/7045 branch Jun 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment