Skip to content

Commit

Permalink
Fix the multi-paragraph issue and the dangerouslySetInnerHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
youknowriad committed Apr 13, 2017
1 parent 3e1e031 commit 12db3e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
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

0 comments on commit 12db3e9

Please sign in to comment.