Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix the multi-paragraph issue and the dangerouslySetInnerHTML
  • Loading branch information
youknowriad committed Apr 13, 2017
commit 12db3e9014d87ac4f2d4228131a66c28fcc6ed9b
22 changes: 11 additions & 11 deletions blocks/library/quote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ registerBlock( 'core/quote', {
category: 'common',

attributes: {
value: ( node ) => query( 'blockquote > p', html() )( node ).join(),
value: ( node ) => query( 'blockquote > p', html() )( node )
.map( innerHTML => `<p>${ innerHTML }</p>` )
.join( '' ),
citation: html( 'footer' )
},

Expand All @@ -36,15 +38,13 @@ registerBlock( 'core/quote', {

save( attributes ) {
const { value, citation } = attributes;
return (
<blockquote>
{ value }
{ !! citation &&
<footer>
{ citation }
</footer>
}
</blockquote>
);
return [
'<blockquote>',
value,
citation
? `<footer>${ citation }</footer>`
: '',
'</blockquote>'
].join( '' );
}
} );
2 changes: 1 addition & 1 deletion blocks/library/quote/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
margin-left: 1.3em;
position: relative;

&:after {
&:before {
content: '— ';
position: absolute;
left: -1.3em;
Expand Down