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

preserve quote content #12122

Merged
merged 2 commits into from Nov 20, 2018
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/block-library/src/quote/index.js
Expand Up @@ -100,7 +100,10 @@ export const settings = {
},
{
type: 'raw',
selector: 'blockquote',
isMatch: ( node ) => (
node.nodeName === 'BLOCKQUOTE' &&
Array.from( node.childNodes ).every( ( child ) => child.nodeName === 'P' )
),
schema: {
blockquote: {
children: {
Expand Down
10 changes: 9 additions & 1 deletion test/integration/__snapshots__/blocks-raw-handling.spec.js.snap
Expand Up @@ -44,5 +44,13 @@ exports[`Blocks raw handling rawHandler should convert HTML post to blocks with

<!-- wp:list {\\"ordered\\":true} -->
<ol><li>Item</li></ol>
<!-- /wp:list -->"
<!-- /wp:list -->

<!-- wp:quote -->
<blockquote class=\\"wp-block-quote\\"><p>Text.</p></blockquote>
<!-- /wp:quote -->

<!-- wp:html -->
<blockquote><h1>Heading</h1><p>Text.</p></blockquote>
<!-- /wp:html -->"
`;
13 changes: 13 additions & 0 deletions test/integration/fixtures/wordpress-convert.html
Expand Up @@ -23,3 +23,16 @@ <h3>Shortcode</h3>
<li>Item</li>
</ol>
</ol>

<!-- Quote with paragraphs -->

<blockquote>
<p>Text.</p>
</blockquote>

<!-- Quote with more than paragraphs -->

<blockquote>
<h1>Heading</h1>
<p>Text.</p>
</blockquote>