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

Take into account citation when transform a quote to paragraph #10685

Merged
merged 4 commits into from Oct 17, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/block-library/src/quote/index.js
Expand Up @@ -97,8 +97,8 @@ export const settings = {
{
type: 'block',
blocks: [ 'core/paragraph' ],
transform: ( { value } ) =>
split( create( { html: value, multilineTag: 'p' } ), '\u2028' )
transform: ( { value, citation } ) =>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be added after split, no? No need to parse it.

split( create( { html: value + `<p>${ citation }</p>`, multilineTag: 'p' } ), '\u2028' )
.map( ( piece ) =>
createBlock( 'core/paragraph', {
content: toHTMLString( piece ),
Expand Down