Skip to content

Commit

Permalink
Quote v2: update raw transform to support <blockquote><p><cite>
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal committed Mar 25, 2022
1 parent d751b9b commit 9c2650a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/block-library/src/quote/v2/transforms.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,15 @@ const transforms = {
node.nodeName === 'FIGURE' &&
!! node.querySelector( 'blockquote' ),
transform: ( node ) => {
const cite = node.querySelector( 'cite' );
const attribution =
cite?.innerHTML ??
node.querySelector( 'figcaption' )?.innerHTML;
cite?.parentNode?.removeChild( cite );
return createBlock(
'core/quote',
{
attribution: node.querySelector( 'figcaption' )
?.innerHTML,
attribution,
},
rawHandler( {
HTML: node.querySelector( 'blockquote' ).innerHTML,
Expand Down

0 comments on commit 9c2650a

Please sign in to comment.