From 101438904b3737a3d8858643d49abdc172c32411 Mon Sep 17 00:00:00 2001 From: Dennis Snell Date: Tue, 6 Nov 2018 19:58:42 -0600 Subject: [PATCH] Parser: Add new list of HTML fragments to parse output (#11334) Attempt three at including positional information from the parse to enable isomorphic reconstruction of the source `post_content` after parsing. See alternate attempts: #11082, #11309 Motivated by: #7247, #8760, automattic/jetpack#10256 Enables: #10463, #10108 ## Abstract Add new `innerContent` property to each block in parser output indicating where in the innerHTML each innerBlock was found. ## Status - will update fixtures after design review indicates this is the desired approach - all parsers passing new tests for fragment behavior ## Summary Inner blocks, or nested blocks, or blocks-within-blocks, can exist in Gutenberg posts. They are serialized in `post_content` in place as normal blocks which exist in between another block's comment delimiters. ```html Check out my and my other with its own content. ``` The way this gets parsed leaves us in a quandary: we cannot reconstruct the original `post_content` after parsing because we lose the origin location information for each inner block since they are only passed as an array of inner blocks. ```json { "blockName": "core/outerBlock", "attrs": {}, "innerBlocks": [ { "blockName": "core/voidInnerBlock", "attrs": {}, "innerBlocks": [], "innerHTML": "" }, { "blockName": "core/innerBlock", "attrs": {}, "innerBlocks": [], "innerHTML": "\nwith its own content.\n" } ], "innerHTML": "\nCheck out my\n\nand my other\n\n" } ``` At this point we have parsed the blocks and prepared them for attaching into the JavaScript block code that interprets them but we have lost our reverse transformation. In this PR I'd like to introduce a new mechanism which shouldn't break existing functionality but which will enable us to go back and forth isomorphically between the `post_content` and first stage of parsing. If we can tear apart a Gutenberg post and reassemble then it will let us to structurally-informed processing of the posts without needing to be aware of all the block JavaScript. The proposed mechanism is a new property as a **list of HTML fragments with `null` values interspersed between those fragments where the blocks were found**. ```json { "blockName": "core/outerBlock", "attrs": {}, "innerBlocks": [ { "blockName": "core/voidInnerBlock", "attrs": {}, "innerBlocks": [], "blockMarkers": [], "innerHTML": "" }, { "blockName": "core/innerBlock", "attrs": {}, "innerBlocks": [], "blockMarkers": [], "innerHTML": "\nwith its own content.\n" } ], "innerHTML": "\nCheck out my\n\nand my other\n\n", "innerContent": [ "\nCheck out my\n", null, "\n and my other\n", null, "\n" ], } ``` Doing this allows us to replace those `null` values with their associated block (sequentially) from `innerBlocks`. ## Questions - Why not use a string token instead of an array? - See #11309. The fundamental problem with the token is that it could be valid content input from a person and so there's a probability that we would fail to split the content accurately. - Why add the `null` instead of leaving basic array splits like `[ 'before', 'after' ]`? - By inspection we can see that without an explicit marker we don't know if the block came before or after or between array elements. We could add empty strings `''` and say that blocks exist only _between_ array elements but the parser code would have to be more complicated to make sure we appropriately add those empty strings. The empty strings are a bit odd anyway. - Why add a new property? - Code already depends on `innerHTML` and `innerBlocks`; I don't want to break any existing behaviors and adding is less risky than changing. --- lib/parser.php | 260 ++++++++++++---- .../parser.php | 45 ++- .../src/index.js | 39 +-- .../test/__snapshots__/index.js.snap | 6 + .../grammar.pegjs | 79 +++-- .../block-serialization-spec-parser/parser.js | 287 ++++++++++++++---- .../shared-tests.js | 27 ++ .../test/__snapshots__/index.js.snap | 6 + ...ore__4-invalid-starting-letter.parsed.json | 5 +- .../fixtures/core__archives.parsed.json | 3 +- ...core__archives__showPostCounts.parsed.json | 3 +- .../fixtures/core__audio.parsed.json | 6 +- .../fixtures/core__block.parsed.json | 6 +- .../fixtures/core__button__center.parsed.json | 6 +- .../fixtures/core__categories.parsed.json | 6 +- .../fixtures/core__code.parsed.json | 6 +- .../fixtures/core__column.parsed.json | 12 +- .../fixtures/core__columns.parsed.json | 52 +++- .../core__columns__deprecated.parsed.json | 38 ++- .../fixtures/core__cover.parsed.json | 10 +- .../core__cover__video-overlay.parsed.json | 10 +- .../fixtures/core__cover__video.parsed.json | 10 +- .../fixtures/core__embed.parsed.json | 10 +- .../core__file__new-window.parsed.json | 10 +- ...core__file__no-download-button.parsed.json | 10 +- .../core__file__no-text-link.parsed.json | 10 +- .../fixtures/core__freeform.parsed.json | 10 +- .../core__freeform__undelimited.parsed.json | 5 +- .../fixtures/core__gallery.parsed.json | 10 +- .../core__gallery__columns.parsed.json | 10 +- .../fixtures/core__heading__h2-em.parsed.json | 10 +- .../fixtures/core__heading__h2.parsed.json | 10 +- .../fixtures/core__html.parsed.json | 10 +- .../fixtures/core__image.parsed.json | 10 +- .../core__image__attachment-link.parsed.json | 10 +- .../core__image__center-caption.parsed.json | 10 +- .../core__image__custom-link.parsed.json | 10 +- .../core__image__media-link.parsed.json | 10 +- .../core__invalid-Capitals.parsed.json | 5 +- .../core__invalid-special.parsed.json | 5 +- .../core__latest-comments.parsed.json | 8 +- .../fixtures/core__latest-posts.parsed.json | 8 +- ..._latest-posts__displayPostDate.parsed.json | 8 +- .../fixtures/core__list__ul.parsed.json | 10 +- .../fixtures/core__media-text.parsed.json | 17 +- ...media-text__image-alt-no-align.parsed.json | 17 +- ...dia-text__is-stacked-on-mobile.parsed.json | 17 +- ...text__media-right-custom-width.parsed.json | 17 +- .../core__media-text__video.parsed.json | 17 +- .../fixtures/core__missing.parsed.json | 6 +- .../fixtures/core__more.parsed.json | 6 +- ...core__more__custom-text-teaser.parsed.json | 6 +- .../fixtures/core__nextpage.parsed.json | 6 +- .../core__paragraph__align-right.parsed.json | 6 +- .../core__paragraph__deprecated.parsed.json | 6 +- .../fixtures/core__preformatted.parsed.json | 6 +- .../fixtures/core__pullquote.parsed.json | 6 +- ...re__pullquote__multi-paragraph.parsed.json | 6 +- .../fixtures/core__quote__style-1.parsed.json | 6 +- .../fixtures/core__quote__style-2.parsed.json | 6 +- .../fixtures/core__separator.parsed.json | 6 +- .../fixtures/core__shortcode.parsed.json | 6 +- .../fixtures/core__spacer.parsed.json | 6 +- .../fixtures/core__subhead.parsed.json | 6 +- .../fixtures/core__table.parsed.json | 6 +- .../fixtures/core__text-columns.parsed.json | 6 +- ...e__text__converts-to-paragraph.parsed.json | 6 +- .../fixtures/core__verse.parsed.json | 6 +- .../fixtures/core__video.parsed.json | 6 +- 69 files changed, 1017 insertions(+), 309 deletions(-) diff --git a/lib/parser.php b/lib/parser.php index 330249196861a..85ca8213c3e60 100644 --- a/lib/parser.php +++ b/lib/parser.php @@ -259,20 +259,22 @@ private function peg_f1($pre, $bs, $post) { return peg_join_blocks( $pre, $bs, $ private function peg_f2($blockName, $a) { return $a; } private function peg_f3($blockName, $attrs) { return array( - 'blockName' => $blockName, - 'attrs' => isset( $attrs ) ? $attrs : array(), - 'innerBlocks' => array(), - 'innerHTML' => '', + 'blockName' => $blockName, + 'attrs' => isset( $attrs ) ? $attrs : array(), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), ); } private function peg_f4($s, $children, $e) { - list( $innerHTML, $innerBlocks ) = peg_array_partition( $children, 'is_string' ); + list( $innerHTML, $innerBlocks, $innerContent ) = peg_process_inner_content( $children ); return array( 'blockName' => $s['blockName'], 'attrs' => $s['attrs'], 'innerBlocks' => $innerBlocks, - 'innerHTML' => implode( '', $innerHTML ), + 'innerHTML' => $innerHTML, + 'innerContent' => $innerContent, ); } private function peg_f5($blockName, $attrs) { @@ -711,36 +713,106 @@ private function peg_parseBlock_Balanced() { $s3 = $this->peg_parseBlock(); if ($s3 === $this->peg_FAILED) { $s3 = $this->peg_currPos; - $s4 = $this->peg_currPos; + $s4 = array(); $s5 = $this->peg_currPos; + $s6 = $this->peg_currPos; $this->peg_silentFails++; - $s6 = $this->peg_parseBlock_End(); + $s7 = $this->peg_parseBlock(); $this->peg_silentFails--; - if ($s6 === $this->peg_FAILED) { - $s5 = null; + if ($s7 === $this->peg_FAILED) { + $s6 = null; + } else { + $this->peg_currPos = $s6; + $s6 = $this->peg_FAILED; + } + if ($s6 !== $this->peg_FAILED) { + $s7 = $this->peg_currPos; + $this->peg_silentFails++; + $s8 = $this->peg_parseBlock_End(); + $this->peg_silentFails--; + if ($s8 === $this->peg_FAILED) { + $s7 = null; + } else { + $this->peg_currPos = $s7; + $s7 = $this->peg_FAILED; + } + if ($s7 !== $this->peg_FAILED) { + if ($this->input_length > $this->peg_currPos) { + $s8 = $this->input_substr($this->peg_currPos, 1); + $this->peg_currPos++; + } else { + $s8 = $this->peg_FAILED; + if ($this->peg_silentFails === 0) { + $this->peg_fail($this->peg_c0); + } + } + if ($s8 !== $this->peg_FAILED) { + $s6 = array($s6, $s7, $s8); + $s5 = $s6; + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } } else { $this->peg_currPos = $s5; $s5 = $this->peg_FAILED; } if ($s5 !== $this->peg_FAILED) { - if ($this->input_length > $this->peg_currPos) { - $s6 = $this->input_substr($this->peg_currPos, 1); - $this->peg_currPos++; - } else { - $s6 = $this->peg_FAILED; - if ($this->peg_silentFails === 0) { - $this->peg_fail($this->peg_c0); + while ($s5 !== $this->peg_FAILED) { + $s4[] = $s5; + $s5 = $this->peg_currPos; + $s6 = $this->peg_currPos; + $this->peg_silentFails++; + $s7 = $this->peg_parseBlock(); + $this->peg_silentFails--; + if ($s7 === $this->peg_FAILED) { + $s6 = null; + } else { + $this->peg_currPos = $s6; + $s6 = $this->peg_FAILED; + } + if ($s6 !== $this->peg_FAILED) { + $s7 = $this->peg_currPos; + $this->peg_silentFails++; + $s8 = $this->peg_parseBlock_End(); + $this->peg_silentFails--; + if ($s8 === $this->peg_FAILED) { + $s7 = null; + } else { + $this->peg_currPos = $s7; + $s7 = $this->peg_FAILED; + } + if ($s7 !== $this->peg_FAILED) { + if ($this->input_length > $this->peg_currPos) { + $s8 = $this->input_substr($this->peg_currPos, 1); + $this->peg_currPos++; + } else { + $s8 = $this->peg_FAILED; + if ($this->peg_silentFails === 0) { + $this->peg_fail($this->peg_c0); + } + } + if ($s8 !== $this->peg_FAILED) { + $s6 = array($s6, $s7, $s8); + $s5 = $s6; + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; } - } - if ($s6 !== $this->peg_FAILED) { - $s5 = array($s5, $s6); - $s4 = $s5; - } else { - $this->peg_currPos = $s4; - $s4 = $this->peg_FAILED; } } else { - $this->peg_currPos = $s4; $s4 = $this->peg_FAILED; } if ($s4 !== $this->peg_FAILED) { @@ -754,36 +826,106 @@ private function peg_parseBlock_Balanced() { $s3 = $this->peg_parseBlock(); if ($s3 === $this->peg_FAILED) { $s3 = $this->peg_currPos; - $s4 = $this->peg_currPos; + $s4 = array(); $s5 = $this->peg_currPos; + $s6 = $this->peg_currPos; $this->peg_silentFails++; - $s6 = $this->peg_parseBlock_End(); + $s7 = $this->peg_parseBlock(); $this->peg_silentFails--; - if ($s6 === $this->peg_FAILED) { - $s5 = null; + if ($s7 === $this->peg_FAILED) { + $s6 = null; + } else { + $this->peg_currPos = $s6; + $s6 = $this->peg_FAILED; + } + if ($s6 !== $this->peg_FAILED) { + $s7 = $this->peg_currPos; + $this->peg_silentFails++; + $s8 = $this->peg_parseBlock_End(); + $this->peg_silentFails--; + if ($s8 === $this->peg_FAILED) { + $s7 = null; + } else { + $this->peg_currPos = $s7; + $s7 = $this->peg_FAILED; + } + if ($s7 !== $this->peg_FAILED) { + if ($this->input_length > $this->peg_currPos) { + $s8 = $this->input_substr($this->peg_currPos, 1); + $this->peg_currPos++; + } else { + $s8 = $this->peg_FAILED; + if ($this->peg_silentFails === 0) { + $this->peg_fail($this->peg_c0); + } + } + if ($s8 !== $this->peg_FAILED) { + $s6 = array($s6, $s7, $s8); + $s5 = $s6; + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } } else { $this->peg_currPos = $s5; $s5 = $this->peg_FAILED; } if ($s5 !== $this->peg_FAILED) { - if ($this->input_length > $this->peg_currPos) { - $s6 = $this->input_substr($this->peg_currPos, 1); - $this->peg_currPos++; - } else { - $s6 = $this->peg_FAILED; - if ($this->peg_silentFails === 0) { - $this->peg_fail($this->peg_c0); + while ($s5 !== $this->peg_FAILED) { + $s4[] = $s5; + $s5 = $this->peg_currPos; + $s6 = $this->peg_currPos; + $this->peg_silentFails++; + $s7 = $this->peg_parseBlock(); + $this->peg_silentFails--; + if ($s7 === $this->peg_FAILED) { + $s6 = null; + } else { + $this->peg_currPos = $s6; + $s6 = $this->peg_FAILED; + } + if ($s6 !== $this->peg_FAILED) { + $s7 = $this->peg_currPos; + $this->peg_silentFails++; + $s8 = $this->peg_parseBlock_End(); + $this->peg_silentFails--; + if ($s8 === $this->peg_FAILED) { + $s7 = null; + } else { + $this->peg_currPos = $s7; + $s7 = $this->peg_FAILED; + } + if ($s7 !== $this->peg_FAILED) { + if ($this->input_length > $this->peg_currPos) { + $s8 = $this->input_substr($this->peg_currPos, 1); + $this->peg_currPos++; + } else { + $s8 = $this->peg_FAILED; + if ($this->peg_silentFails === 0) { + $this->peg_fail($this->peg_c0); + } + } + if ($s8 !== $this->peg_FAILED) { + $s6 = array($s6, $s7, $s8); + $s5 = $s6; + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; + } + } else { + $this->peg_currPos = $s5; + $s5 = $this->peg_FAILED; } - } - if ($s6 !== $this->peg_FAILED) { - $s5 = array($s5, $s6); - $s4 = $s5; - } else { - $this->peg_currPos = $s4; - $s4 = $this->peg_FAILED; } } else { - $this->peg_currPos = $s4; $s4 = $this->peg_FAILED; } if ($s4 !== $this->peg_FAILED) { @@ -1441,18 +1583,23 @@ public function parse($input) { // are the same as `json_decode` // array arguments are backwards because of PHP - if ( ! function_exists( 'peg_array_partition' ) ) { - function peg_array_partition( $array, $predicate ) { - $truthy = array(); - $falsey = array(); + if ( ! function_exists( 'peg_process_inner_content' ) ) { + function peg_process_inner_content( $array ) { + $html = ''; + $blocks = array(); + $content = array(); foreach ( $array as $item ) { - call_user_func( $predicate, $item ) - ? $truthy[] = $item - : $falsey[] = $item; + if ( is_string( $item ) ) { + $html .= $item; + $content[] = $item; + } else { + $blocks[] = $item; + $content[] = null; + } } - return array( $truthy, $falsey ); + return array( $html, $blocks, $content ); } } @@ -1465,7 +1612,8 @@ function peg_join_blocks( $pre, $tokens, $post ) { 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $pre + 'innerHTML' => $pre, + 'innerContent' => array( $pre ), ); } @@ -1479,7 +1627,8 @@ function peg_join_blocks( $pre, $tokens, $post ) { 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $html + 'innerHTML' => $html, + 'innerContent' => array( $html ), ); } } @@ -1489,7 +1638,8 @@ function peg_join_blocks( $pre, $tokens, $post ) { 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $post + 'innerHTML' => $post, + 'innerContent' => array( $post ), ); } diff --git a/packages/block-serialization-default-parser/parser.php b/packages/block-serialization-default-parser/parser.php index 9eb8aae492b72..2211cf0c19226 100644 --- a/packages/block-serialization-default-parser/parser.php +++ b/packages/block-serialization-default-parser/parser.php @@ -48,11 +48,26 @@ class WP_Block_Parser_Block { */ public $innerHTML; - function __construct( $name, $attrs, $innerBlocks, $innerHTML ) { + /** + * List of string fragments and null markers where inner blocks were found + * + * @example array( + * 'innerHTML' => 'BeforeInnerAfter', + * 'innerBlocks' => array( block, block ), + * 'innerContent' => array( 'Before', null, 'Inner', null, 'After' ), + * ) + * + * @since 4.2.0 + * @var array + */ + public $innerContent; + + function __construct( $name, $attrs, $innerBlocks, $innerHTML, $innerContent ) { $this->blockName = $name; $this->attrs = $attrs; $this->innerBlocks = $innerBlocks; $this->innerHTML = $innerHTML; + $this->innerContent = $innerContent; } } @@ -252,14 +267,14 @@ function proceed() { ) ); } - $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '' ); + $this->output[] = (array) new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ); $this->offset = $start_offset + $token_length; return true; } // otherwise we found an inner block $this->add_inner_block( - new WP_Block_Parser_Block( $block_name, $attrs, array(), '' ), + new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), $start_offset, $token_length ); @@ -269,7 +284,7 @@ function proceed() { case 'block-opener': // track all newly-opened blocks on the stack array_push( $this->stack, new WP_Block_Parser_Frame( - new WP_Block_Parser_Block( $block_name, $attrs, array(), '' ), + new WP_Block_Parser_Block( $block_name, $attrs, array(), '', array() ), $start_offset, $token_length, $start_offset + $token_length, @@ -306,7 +321,9 @@ function proceed() { * block and add it as a new innerBlock to the parent */ $stack_top = array_pop( $this->stack ); - $stack_top->block->innerHTML .= substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); + $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); + $stack_top->block->innerHTML .= $html; + $stack_top->block->innerContent[] = $html; $stack_top->prev_offset = $start_offset + $token_length; $this->add_inner_block( @@ -406,7 +423,7 @@ function next_token() { * @return WP_Block_Parser_Block freeform block object */ static function freeform( $innerHTML ) { - return new WP_Block_Parser_Block( null, array(), array(), $innerHTML ); + return new WP_Block_Parser_Block( null, array(), array(), $innerHTML, array( $innerHTML ) ); } /** @@ -441,7 +458,14 @@ function add_freeform( $length = null ) { function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { $parent = $this->stack[ count( $this->stack ) - 1 ]; $parent->block->innerBlocks[] = $block; - $parent->block->innerHTML .= substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); + $html = substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ); + + if ( ! empty( $html ) ) { + $parent->block->innerHTML .= $html; + $parent->block->innerContent[] = $html; + } + + $parent->block->innerContent[] = null; $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; } @@ -456,10 +480,15 @@ function add_block_from_stack( $end_offset = null ) { $stack_top = array_pop( $this->stack ); $prev_offset = $stack_top->prev_offset; - $stack_top->block->innerHTML .= isset( $end_offset ) + $html = isset( $end_offset ) ? substr( $this->document, $prev_offset, $end_offset - $prev_offset ) : substr( $this->document, $prev_offset ); + if ( ! empty( $html ) ) { + $stack_top->block->innerHTML .= $html; + $stack_top->block->innerContent[] = $html; + } + if ( isset( $stack_top->leading_html_start ) ) { $this->output[] = (array) self::freeform( substr( $this->document, diff --git a/packages/block-serialization-default-parser/src/index.js b/packages/block-serialization-default-parser/src/index.js index 27dd93bb9fb0f..577284fc1e539 100644 --- a/packages/block-serialization-default-parser/src/index.js +++ b/packages/block-serialization-default-parser/src/index.js @@ -4,17 +4,18 @@ let output; let stack; const tokenizer = /)[^])+?}\s+)?(\/)?-->/g; -function Block( blockName, attrs, innerBlocks, innerHTML ) { +function Block( blockName, attrs, innerBlocks, innerHTML, innerContent ) { return { blockName, attrs, innerBlocks, innerHTML, + innerContent, }; } function Freeform( innerHTML ) { - return Block( null, {}, [], innerHTML ); + return Block( null, {}, [], innerHTML, [ innerHTML ] ); } function Frame( block, tokenStart, tokenLength, prevOffset, leadingHtmlStart ) { @@ -84,14 +85,14 @@ function proceed() { if ( null !== leadingHtmlStart ) { output.push( Freeform( document.substr( leadingHtmlStart, startOffset - leadingHtmlStart ) ) ); } - output.push( Block( blockName, attrs, [], '' ) ); + output.push( Block( blockName, attrs, [], '', [] ) ); offset = startOffset + tokenLength; return true; } // otherwise we found an inner block addInnerBlock( - Block( blockName, attrs, [], '' ), + Block( blockName, attrs, [], '', [] ), startOffset, tokenLength, ); @@ -102,7 +103,7 @@ function proceed() { // track all newly-opened blocks on the stack stack.push( Frame( - Block( blockName, attrs, [], '' ), + Block( blockName, attrs, [], '', [] ), startOffset, tokenLength, startOffset + tokenLength, @@ -134,10 +135,9 @@ function proceed() { // otherwise we're nested and we have to close out the current // block and add it as a innerBlock to the parent const stackTop = stack.pop(); - stackTop.block.innerHTML += document.substr( - stackTop.prevOffset, - startOffset - stackTop.prevOffset, - ); + const html = document.substr( stackTop.prevOffset, startOffset - stackTop.prevOffset ); + stackTop.block.innerHTML += html; + stackTop.block.innerContent.push( html ); stackTop.prevOffset = startOffset + tokenLength; addInnerBlock( @@ -230,20 +230,25 @@ function addFreeform( rawLength ) { function addInnerBlock( block, tokenStart, tokenLength, lastOffset ) { const parent = stack[ stack.length - 1 ]; parent.block.innerBlocks.push( block ); - parent.block.innerHTML += document.substr( - parent.prevOffset, - tokenStart - parent.prevOffset, - ); + const html = document.substr( parent.prevOffset, tokenStart - parent.prevOffset ); + + if ( html ) { + parent.block.innerHTML += html; + parent.block.innerContent.push( html ); + } + + parent.block.innerContent.push( null ); parent.prevOffset = lastOffset ? lastOffset : tokenStart + tokenLength; } function addBlockFromStack( endOffset ) { const { block, leadingHtmlStart, prevOffset, tokenStart } = stack.pop(); - if ( endOffset ) { - block.innerHTML += document.substr( prevOffset, endOffset - prevOffset ); - } else { - block.innerHTML += document.substr( prevOffset ); + const html = endOffset ? document.substr( prevOffset, endOffset - prevOffset ) : document.substr( prevOffset ); + + if ( html ) { + block.innerHTML += html; + block.innerContent.push( html ); } if ( null !== leadingHtmlStart ) { diff --git a/packages/block-serialization-default-parser/test/__snapshots__/index.js.snap b/packages/block-serialization-default-parser/test/__snapshots__/index.js.snap index 5b5abb61a3d2e..4a6910fa35f61 100644 --- a/packages/block-serialization-default-parser/test/__snapshots__/index.js.snap +++ b/packages/block-serialization-default-parser/test/__snapshots__/index.js.snap @@ -6,6 +6,9 @@ Array [ "attrs": Object {}, "blockName": "core/more", "innerBlocks": Array [], + "innerContent": Array [ + "", + ], "innerHTML": "", }, ] @@ -17,6 +20,9 @@ Array [ "attrs": Object {}, "blockName": "core/more", "innerBlocks": Array [], + "innerContent": Array [ + "", + ], "innerHTML": "", }, ] diff --git a/packages/block-serialization-spec-parser/grammar.pegjs b/packages/block-serialization-spec-parser/grammar.pegjs index 00d1fec211413..4bf80d2f6755a 100644 --- a/packages/block-serialization-spec-parser/grammar.pegjs +++ b/packages/block-serialization-spec-parser/grammar.pegjs @@ -51,18 +51,23 @@ // are the same as `json_decode` // array arguments are backwards because of PHP -if ( ! function_exists( 'peg_array_partition' ) ) { - function peg_array_partition( $array, $predicate ) { - $truthy = array(); - $falsey = array(); +if ( ! function_exists( 'peg_process_inner_content' ) ) { + function peg_process_inner_content( $array ) { + $html = ''; + $blocks = array(); + $content = array(); foreach ( $array as $item ) { - call_user_func( $predicate, $item ) - ? $truthy[] = $item - : $falsey[] = $item; + if ( is_string( $item ) ) { + $html .= $item; + $content[] = $item; + } else { + $blocks[] = $item; + $content[] = null; + } } - return array( $truthy, $falsey ); + return array( $html, $blocks, $content ); } } @@ -75,7 +80,8 @@ if ( ! function_exists( 'peg_join_blocks' ) ) { 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $pre + 'innerHTML' => $pre, + 'innerContent' => array( $pre ), ); } @@ -89,7 +95,8 @@ if ( ! function_exists( 'peg_join_blocks' ) ) { 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $html + 'innerHTML' => $html, + 'innerContent' => array( $html ), ); } } @@ -99,7 +106,8 @@ if ( ! function_exists( 'peg_join_blocks' ) ) { 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $post + 'innerHTML' => $post, + 'innerContent' => array( $post ), ); } @@ -115,6 +123,7 @@ function freeform( s ) { attrs: {}, innerBlocks: [], innerHTML: s, + innerContent: [ s ], }; } @@ -151,22 +160,27 @@ function maybeJSON( s ) { } } -function partition( predicate, list ) { +function processInnerContent( list ) { var i, l, item; - var truthy = []; - var falsey = []; + var html = ''; + var blocks = []; + var content = []; // nod to performance over a simpler reduce // and clone model we could have taken here for ( i = 0, l = list.length; i < l; i++ ) { item = list[ i ]; - predicate( item ) - ? truthy.push( item ) - : falsey.push( item ) + if ( 'string' === typeof item ) { + html += item; + content.push( item ); + } else { + blocks.push( item ); + content.push( null ); + } }; - return [ truthy, falsey ]; + return [ html, blocks, content ]; } } @@ -197,10 +211,11 @@ Block_Void { /** $blockName, - 'attrs' => isset( $attrs ) ? $attrs : array(), - 'innerBlocks' => array(), - 'innerHTML' => '', + 'blockName' => $blockName, + 'attrs' => isset( $attrs ) ? $attrs : array(), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), ); ?> **/ @@ -208,33 +223,37 @@ Block_Void blockName: blockName, attrs: attrs || {}, innerBlocks: [], - innerHTML: '' + innerHTML: '', + innerContent: [] }; } Block_Balanced - = s:Block_Start children:(Block / $(!Block_End .))* e:Block_End + = s:Block_Start children:(Block / $((!Block !Block_End .)+))* e:Block_End { /** $s['blockName'], 'attrs' => $s['attrs'], 'innerBlocks' => $innerBlocks, - 'innerHTML' => implode( '', $innerHTML ), + 'innerHTML' => $innerHTML, + 'innerContent' => $innerContent, ); ?> **/ - var innerContent = partition( function( a ) { return 'string' === typeof a }, children ); - var innerHTML = innerContent[ 0 ]; - var innerBlocks = innerContent[ 1 ]; + var innerParts = processInnerContent( children ); + var innerHTML = innerParts[ 0 ]; + var innerBlocks = innerParts[ 1 ]; + var innerContent = innerParts[ 2 ]; return { blockName: s.blockName, attrs: s.attrs, innerBlocks: innerBlocks, - innerHTML: innerHTML.join( '' ) + innerHTML: innerHTML, + innerContent: innerContent, }; } diff --git a/packages/block-serialization-spec-parser/parser.js b/packages/block-serialization-spec-parser/parser.js index e716efb9e3e8d..85fdc6ec9b5d6 100644 --- a/packages/block-serialization-spec-parser/parser.js +++ b/packages/block-serialization-spec-parser/parser.js @@ -165,10 +165,11 @@ peg$c10 = function(blockName, attrs) { /** $blockName, - 'attrs' => isset( $attrs ) ? $attrs : array(), - 'innerBlocks' => array(), - 'innerHTML' => '', + 'blockName' => $blockName, + 'attrs' => isset( $attrs ) ? $attrs : array(), + 'innerBlocks' => array(), + 'innerHTML' => '', + 'innerContent' => array(), ); ?> **/ @@ -176,30 +177,34 @@ blockName: blockName, attrs: attrs || {}, innerBlocks: [], - innerHTML: '' + innerHTML: '', + innerContent: [] }; }, peg$c11 = function(s, children, e) { /** $s['blockName'], 'attrs' => $s['attrs'], 'innerBlocks' => $innerBlocks, - 'innerHTML' => implode( '', $innerHTML ), + 'innerHTML' => $innerHTML, + 'innerContent' => $innerContent, ); ?> **/ - var innerContent = partition( function( a ) { return 'string' === typeof a }, children ); - var innerHTML = innerContent[ 0 ]; - var innerBlocks = innerContent[ 1 ]; + var innerParts = processInnerContent( children ); + var innerHTML = innerParts[ 0 ]; + var innerBlocks = innerParts[ 1 ]; + var innerContent = innerParts[ 2 ]; return { blockName: s.blockName, attrs: s.attrs, innerBlocks: innerBlocks, - innerHTML: innerHTML.join( '' ) + innerHTML: innerHTML, + innerContent: innerContent, }; }, peg$c12 = "-->", @@ -784,7 +789,7 @@ } function peg$parseBlock_Balanced() { - var s0, s1, s2, s3, s4, s5, s6; + var s0, s1, s2, s3, s4, s5, s6, s7, s8; s0 = peg$currPos; s1 = peg$parseBlock_Start(); @@ -793,34 +798,102 @@ s3 = peg$parseBlock(); if (s3 === peg$FAILED) { s3 = peg$currPos; - s4 = peg$currPos; + s4 = []; s5 = peg$currPos; + s6 = peg$currPos; peg$silentFails++; - s6 = peg$parseBlock_End(); + s7 = peg$parseBlock(); peg$silentFails--; - if (s6 === peg$FAILED) { - s5 = void 0; + if (s7 === peg$FAILED) { + s6 = void 0; } else { - peg$currPos = s5; - s5 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } - if (s5 !== peg$FAILED) { - if (input.length > peg$currPos) { - s6 = input.charAt(peg$currPos); - peg$currPos++; + if (s6 !== peg$FAILED) { + s7 = peg$currPos; + peg$silentFails++; + s8 = peg$parseBlock_End(); + peg$silentFails--; + if (s8 === peg$FAILED) { + s7 = void 0; } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c0); } + peg$currPos = s7; + s7 = peg$FAILED; } - if (s6 !== peg$FAILED) { - s5 = [s5, s6]; - s4 = s5; + if (s7 !== peg$FAILED) { + if (input.length > peg$currPos) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c0); } + } + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } } else { - peg$currPos = s4; - s4 = peg$FAILED; + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + if (s5 !== peg$FAILED) { + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$currPos; + s6 = peg$currPos; + peg$silentFails++; + s7 = peg$parseBlock(); + peg$silentFails--; + if (s7 === peg$FAILED) { + s6 = void 0; + } else { + peg$currPos = s6; + s6 = peg$FAILED; + } + if (s6 !== peg$FAILED) { + s7 = peg$currPos; + peg$silentFails++; + s8 = peg$parseBlock_End(); + peg$silentFails--; + if (s8 === peg$FAILED) { + s7 = void 0; + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + if (s7 !== peg$FAILED) { + if (input.length > peg$currPos) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c0); } + } + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } } } else { - peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { @@ -834,34 +907,102 @@ s3 = peg$parseBlock(); if (s3 === peg$FAILED) { s3 = peg$currPos; - s4 = peg$currPos; + s4 = []; s5 = peg$currPos; + s6 = peg$currPos; peg$silentFails++; - s6 = peg$parseBlock_End(); + s7 = peg$parseBlock(); peg$silentFails--; - if (s6 === peg$FAILED) { - s5 = void 0; + if (s7 === peg$FAILED) { + s6 = void 0; } else { - peg$currPos = s5; - s5 = peg$FAILED; + peg$currPos = s6; + s6 = peg$FAILED; } - if (s5 !== peg$FAILED) { - if (input.length > peg$currPos) { - s6 = input.charAt(peg$currPos); - peg$currPos++; + if (s6 !== peg$FAILED) { + s7 = peg$currPos; + peg$silentFails++; + s8 = peg$parseBlock_End(); + peg$silentFails--; + if (s8 === peg$FAILED) { + s7 = void 0; } else { - s6 = peg$FAILED; - if (peg$silentFails === 0) { peg$fail(peg$c0); } + peg$currPos = s7; + s7 = peg$FAILED; } - if (s6 !== peg$FAILED) { - s5 = [s5, s6]; - s4 = s5; + if (s7 !== peg$FAILED) { + if (input.length > peg$currPos) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c0); } + } + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } } else { - peg$currPos = s4; - s4 = peg$FAILED; + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + if (s5 !== peg$FAILED) { + while (s5 !== peg$FAILED) { + s4.push(s5); + s5 = peg$currPos; + s6 = peg$currPos; + peg$silentFails++; + s7 = peg$parseBlock(); + peg$silentFails--; + if (s7 === peg$FAILED) { + s6 = void 0; + } else { + peg$currPos = s6; + s6 = peg$FAILED; + } + if (s6 !== peg$FAILED) { + s7 = peg$currPos; + peg$silentFails++; + s8 = peg$parseBlock_End(); + peg$silentFails--; + if (s8 === peg$FAILED) { + s7 = void 0; + } else { + peg$currPos = s7; + s7 = peg$FAILED; + } + if (s7 !== peg$FAILED) { + if (input.length > peg$currPos) { + s8 = input.charAt(peg$currPos); + peg$currPos++; + } else { + s8 = peg$FAILED; + if (peg$silentFails === 0) { peg$fail(peg$c0); } + } + if (s8 !== peg$FAILED) { + s6 = [s6, s7, s8]; + s5 = s6; + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } + } else { + peg$currPos = s5; + s5 = peg$FAILED; + } } } else { - peg$currPos = s4; s4 = peg$FAILED; } if (s4 !== peg$FAILED) { @@ -1478,18 +1619,23 @@ // are the same as `json_decode` // array arguments are backwards because of PHP - if ( ! function_exists( 'peg_array_partition' ) ) { - function peg_array_partition( $array, $predicate ) { - $truthy = array(); - $falsey = array(); + if ( ! function_exists( 'peg_process_inner_content' ) ) { + function peg_process_inner_content( $array ) { + $html = ''; + $blocks = array(); + $content = array(); foreach ( $array as $item ) { - call_user_func( $predicate, $item ) - ? $truthy[] = $item - : $falsey[] = $item; + if ( is_string( $item ) ) { + $html .= $item; + $content[] = $item; + } else { + $blocks[] = $item; + $content[] = null; + } } - return array( $truthy, $falsey ); + return array( $html, $blocks, $content ); } } @@ -1502,7 +1648,8 @@ 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $pre + 'innerHTML' => $pre, + 'innerContent' => array( $pre ), ); } @@ -1516,7 +1663,8 @@ 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $html + 'innerHTML' => $html, + 'innerContent' => array( $html ), ); } } @@ -1526,7 +1674,8 @@ 'blockName' => null, 'attrs' => array(), 'innerBlocks' => array(), - 'innerHTML' => $post + 'innerHTML' => $post, + 'innerContent' => array( $post ), ); } @@ -1542,6 +1691,7 @@ attrs: {}, innerBlocks: [], innerHTML: s, + innerContent: [ s ], }; } @@ -1578,22 +1728,27 @@ } } - function partition( predicate, list ) { + function processInnerContent( list ) { var i, l, item; - var truthy = []; - var falsey = []; + var html = ''; + var blocks = []; + var content = []; // nod to performance over a simpler reduce // and clone model we could have taken here for ( i = 0, l = list.length; i < l; i++ ) { item = list[ i ]; - predicate( item ) - ? truthy.push( item ) - : falsey.push( item ) + if ( 'string' === typeof item ) { + html += item; + content.push( item ); + } else { + blocks.push( item ); + content.push( null ); + } }; - return [ truthy, falsey ]; + return [ html, blocks, content ]; } diff --git a/packages/block-serialization-spec-parser/shared-tests.js b/packages/block-serialization-spec-parser/shared-tests.js index abfee9be4b521..54137636d3afd 100644 --- a/packages/block-serialization-spec-parser/shared-tests.js +++ b/packages/block-serialization-spec-parser/shared-tests.js @@ -62,6 +62,33 @@ export const jsTester = ( parse ) => () => { ] ) ) ); } ); + describe( 'innerBlock placemarkers', () => { + test( 'innerContent exists', () => { + expect( parse( 'test' )[ 0 ] ).toHaveProperty( 'innerContent', [ 'test' ] ); + expect( parse( '' )[ 0 ] ).toHaveProperty( 'innerContent', [] ); + } ); + + test( 'innerContent contains innerHTML', () => { + expect( parse( 'Inner' )[ 0 ] ).toHaveProperty( 'innerContent', [ 'Inner' ] ); + } ); + + test( 'block locations become null', () => { + expect( parse( '' )[ 0 ] ).toHaveProperty( 'innerContent', [ null ] ); + } ); + + test( 'HTML soup appears after blocks', () => { + expect( parse( 'After' )[ 0 ] ).toHaveProperty( 'innerContent', [ null, 'After' ] ); + } ); + + test( 'HTML soup appears before blocks', () => { + expect( parse( 'Before' )[ 0 ] ).toHaveProperty( 'innerContent', [ 'Before', null ] ); + } ); + + test( 'blocks follow each other', () => { + expect( parse( '' )[ 0 ] ).toHaveProperty( 'innerContent', [ null, null ] ); + } ); + } ); + describe( 'attack vectors', () => { test( 'really long JSON attribute sections', () => { const length = 100000; diff --git a/packages/block-serialization-spec-parser/test/__snapshots__/index.js.snap b/packages/block-serialization-spec-parser/test/__snapshots__/index.js.snap index 1a014545d9874..480cde5428505 100644 --- a/packages/block-serialization-spec-parser/test/__snapshots__/index.js.snap +++ b/packages/block-serialization-spec-parser/test/__snapshots__/index.js.snap @@ -6,6 +6,9 @@ Array [ "attrs": Object {}, "blockName": "core/more", "innerBlocks": Array [], + "innerContent": Array [ + "", + ], "innerHTML": "", }, ] @@ -17,6 +20,9 @@ Array [ "attrs": Array [], "blockName": "core/more", "innerBlocks": Array [], + "innerContent": Array [ + "", + ], "innerHTML": "", }, ] diff --git a/test/integration/full-content/fixtures/core__4-invalid-starting-letter.parsed.json b/test/integration/full-content/fixtures/core__4-invalid-starting-letter.parsed.json index 2dfce101b41c9..b3c0c79ad5cf3 100644 --- a/test/integration/full-content/fixtures/core__4-invalid-starting-letter.parsed.json +++ b/test/integration/full-content/fixtures/core__4-invalid-starting-letter.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__archives.parsed.json b/test/integration/full-content/fixtures/core__archives.parsed.json index fab690ff93afd..f974a7a167ab3 100644 --- a/test/integration/full-content/fixtures/core__archives.parsed.json +++ b/test/integration/full-content/fixtures/core__archives.parsed.json @@ -6,6 +6,7 @@ "showPostCounts": false }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] } ] diff --git a/test/integration/full-content/fixtures/core__archives__showPostCounts.parsed.json b/test/integration/full-content/fixtures/core__archives__showPostCounts.parsed.json index cd58cbf96924d..88439c3fc9ff0 100644 --- a/test/integration/full-content/fixtures/core__archives__showPostCounts.parsed.json +++ b/test/integration/full-content/fixtures/core__archives__showPostCounts.parsed.json @@ -6,6 +6,7 @@ "showPostCounts": true }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] } ] diff --git a/test/integration/full-content/fixtures/core__audio.parsed.json b/test/integration/full-content/fixtures/core__audio.parsed.json index 33926c0b889b5..6b0acbd0c4a1f 100644 --- a/test/integration/full-content/fixtures/core__audio.parsed.json +++ b/test/integration/full-content/fixtures/core__audio.parsed.json @@ -5,12 +5,14 @@ "align": "right" }, "innerBlocks": [], - "innerHTML": "\n
\n \n
\n" + "innerHTML": "\n
\n \n
\n", + "innerContent": [ "\n
\n \n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__block.parsed.json b/test/integration/full-content/fixtures/core__block.parsed.json index 61b65e317a8e1..33c4d86f6c6c7 100644 --- a/test/integration/full-content/fixtures/core__block.parsed.json +++ b/test/integration/full-content/fixtures/core__block.parsed.json @@ -5,12 +5,14 @@ "ref": 123 }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__button__center.parsed.json b/test/integration/full-content/fixtures/core__button__center.parsed.json index 0094e8f264073..352767e1c1a8f 100644 --- a/test/integration/full-content/fixtures/core__button__center.parsed.json +++ b/test/integration/full-content/fixtures/core__button__center.parsed.json @@ -5,12 +5,14 @@ "align": "center" }, "innerBlocks": [], - "innerHTML": "\n
Help build Gutenberg
\n" + "innerHTML": "\n
Help build Gutenberg
\n", + "innerContent": [ "\n
Help build Gutenberg
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__categories.parsed.json b/test/integration/full-content/fixtures/core__categories.parsed.json index df39a8078db37..60d03d7bc5062 100644 --- a/test/integration/full-content/fixtures/core__categories.parsed.json +++ b/test/integration/full-content/fixtures/core__categories.parsed.json @@ -7,12 +7,14 @@ "showHierarchy": false }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__code.parsed.json b/test/integration/full-content/fixtures/core__code.parsed.json index 5aea1d9a14a01..d9bf0a215e82b 100644 --- a/test/integration/full-content/fixtures/core__code.parsed.json +++ b/test/integration/full-content/fixtures/core__code.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/code", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
export default function MyButton() {\n\treturn <Button>Click Me!</Button>;\n}
\n" + "innerHTML": "\n
export default function MyButton() {\n\treturn <Button>Click Me!</Button>;\n}
\n", + "innerContent": [ "\n
export default function MyButton() {\n\treturn <Button>Click Me!</Button>;\n}
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__column.parsed.json b/test/integration/full-content/fixtures/core__column.parsed.json index 74b53bdf6ae96..10f1e1a07cf05 100644 --- a/test/integration/full-content/fixtures/core__column.parsed.json +++ b/test/integration/full-content/fixtures/core__column.parsed.json @@ -7,21 +7,25 @@ "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t

Column One, Paragraph One

\n\t" + "innerHTML": "\n\t

Column One, Paragraph One

\n\t", + "innerContent": [ "\n\t

Column One, Paragraph One

\n\t" ] }, { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t

Column One, Paragraph Two

\n\t" + "innerHTML": "\n\t

Column One, Paragraph Two

\n\t", + "innerContent": [ "\n\t

Column One, Paragraph Two

\n\t" ] } ], - "innerHTML": "\n
\n\t\n\t\n
\n" + "innerHTML": "\n
\n\t\n\t\n
\n", + "innerContent": [ "\n
\n\t", null, "\n\t", null, "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__columns.parsed.json b/test/integration/full-content/fixtures/core__columns.parsed.json index 9ec5cef66ad23..7dbde278bc08c 100644 --- a/test/integration/full-content/fixtures/core__columns.parsed.json +++ b/test/integration/full-content/fixtures/core__columns.parsed.json @@ -13,16 +13,29 @@ "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column One, Paragraph One

\n\t\t" + "innerHTML": "\n\t\t

Column One, Paragraph One

\n\t\t", + "innerContent": [ + "\n\t\t

Column One, Paragraph One

\n\t\t" + ] }, { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column One, Paragraph Two

\n\t\t" + "innerHTML": "\n\t\t

Column One, Paragraph Two

\n\t\t", + "innerContent": [ + "\n\t\t

Column One, Paragraph Two

\n\t\t" + ] } ], - "innerHTML": "\n\t
\n\t\t\n\t\t\n\t
\n\t" + "innerHTML": "\n\t
\n\t\t\n\t\t\n\t
\n\t", + "innerContent": [ + "\n\t
\n\t\t", + null, + "\n\t\t", + null, + "\n\t
\n\t" + ] }, { "blockName": "core/column", @@ -32,24 +45,47 @@ "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column Two, Paragraph One

\n\t\t" + "innerHTML": "\n\t\t

Column Two, Paragraph One

\n\t\t", + "innerContent": [ + "\n\t\t

Column Two, Paragraph One

\n\t\t" + ] }, { "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\t\t

Column Three, Paragraph One

\n\t\t" + "innerHTML": "\n\t\t

Column Three, Paragraph One

\n\t\t", + "innerContent": [ + "\n\t\t

Column Three, Paragraph One

\n\t\t" + ] } ], - "innerHTML": "\n\t
\n\t\t\n\t\t\n\t
\n\t" + "innerHTML": "\n\t
\n\t\t\n\t\t\n\t
\n\t", + "innerContent": [ + "\n\t
\n\t\t", + null, + "\n\t\t", + null, + "\n\t
\n\t" + ] } ], - "innerHTML": "\n
\n\t\n\t\n
\n" + "innerHTML": "\n
\n\t\n\t\n
\n", + "innerContent": [ + "\n
\n\t", + null, + "\n\t", + null, + "\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__columns__deprecated.parsed.json b/test/integration/full-content/fixtures/core__columns__deprecated.parsed.json index 2d973027f4a5a..6bb604b40ecfb 100644 --- a/test/integration/full-content/fixtures/core__columns__deprecated.parsed.json +++ b/test/integration/full-content/fixtures/core__columns__deprecated.parsed.json @@ -11,7 +11,10 @@ "layout": "column-1" }, "innerBlocks": [], - "innerHTML": "\n\t

Column One, Paragraph One

\n\t" + "innerHTML": "\n\t

Column One, Paragraph One

\n\t", + "innerContent": [ + "\n\t

Column One, Paragraph One

\n\t" + ] }, { "blockName": "core/paragraph", @@ -19,7 +22,10 @@ "layout": "column-1" }, "innerBlocks": [], - "innerHTML": "\n\t

Column One, Paragraph Two

\n\t" + "innerHTML": "\n\t

Column One, Paragraph Two

\n\t", + "innerContent": [ + "\n\t

Column One, Paragraph Two

\n\t" + ] }, { "blockName": "core/paragraph", @@ -27,7 +33,10 @@ "layout": "column-2" }, "innerBlocks": [], - "innerHTML": "\n\t

Column Two, Paragraph One

\n\t" + "innerHTML": "\n\t

Column Two, Paragraph One

\n\t", + "innerContent": [ + "\n\t

Column Two, Paragraph One

\n\t" + ] }, { "blockName": "core/paragraph", @@ -35,15 +44,32 @@ "layout": "column-3" }, "innerBlocks": [], - "innerHTML": "\n\t

Column Three, Paragraph One

\n\t" + "innerHTML": "\n\t

Column Three, Paragraph One

\n\t", + "innerContent": [ + "\n\t

Column Three, Paragraph One

\n\t" + ] } ], - "innerHTML": "\n
\n\t\n\t\n\t\n\t\n
\n" + "innerHTML": "\n
\n\t\n\t\n\t\n\t\n
\n", + "innerContent": [ + "\n
\n\t", + null, + "\n\t", + null, + "\n\t", + null, + "\n\t", + null, + "\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__cover.parsed.json b/test/integration/full-content/fixtures/core__cover.parsed.json index ba371b9c5960f..14f37b617067b 100644 --- a/test/integration/full-content/fixtures/core__cover.parsed.json +++ b/test/integration/full-content/fixtures/core__cover.parsed.json @@ -6,12 +6,18 @@ "dimRatio": 40 }, "innerBlocks": [], - "innerHTML": "\n
\n

Guten Berg!

\n
\n" + "innerHTML": "\n
\n

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n

Guten Berg!

\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__cover__video-overlay.parsed.json b/test/integration/full-content/fixtures/core__cover__video-overlay.parsed.json index 71dd6c0a0294a..a2a3ccc94a713 100644 --- a/test/integration/full-content/fixtures/core__cover__video-overlay.parsed.json +++ b/test/integration/full-content/fixtures/core__cover__video-overlay.parsed.json @@ -8,12 +8,18 @@ "backgroundType": "video" }, "innerBlocks": [], - "innerHTML": "\n
\n\t\n\t

Guten Berg!

\n
\n" + "innerHTML": "\n
\n\t\n\t

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n\t\n\t

Guten Berg!

\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__cover__video.parsed.json b/test/integration/full-content/fixtures/core__cover__video.parsed.json index 218846a689b1f..a864b5fea344e 100644 --- a/test/integration/full-content/fixtures/core__cover__video.parsed.json +++ b/test/integration/full-content/fixtures/core__cover__video.parsed.json @@ -7,12 +7,18 @@ "backgroundType": "video" }, "innerBlocks": [], - "innerHTML": "\n
\n\t\n\t

Guten Berg!

\n
\n" + "innerHTML": "\n
\n\t\n\t

Guten Berg!

\n
\n", + "innerContent": [ + "\n
\n\t\n\t

Guten Berg!

\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__embed.parsed.json b/test/integration/full-content/fixtures/core__embed.parsed.json index 5efa23bb5f83c..43bbfac823cd0 100644 --- a/test/integration/full-content/fixtures/core__embed.parsed.json +++ b/test/integration/full-content/fixtures/core__embed.parsed.json @@ -5,12 +5,18 @@ "url": "https://example.com/" }, "innerBlocks": [], - "innerHTML": "\n
\n
\n https://example.com/\n
\n
Embedded content from an example URL
\n
\n" + "innerHTML": "\n
\n
\n https://example.com/\n
\n
Embedded content from an example URL
\n
\n", + "innerContent": [ + "\n
\n
\n https://example.com/\n
\n
Embedded content from an example URL
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__file__new-window.parsed.json b/test/integration/full-content/fixtures/core__file__new-window.parsed.json index c674f669bc26f..a29bea33c5b2b 100644 --- a/test/integration/full-content/fixtures/core__file__new-window.parsed.json +++ b/test/integration/full-content/fixtures/core__file__new-window.parsed.json @@ -7,12 +7,18 @@ "id": 176 }, "innerBlocks": [], - "innerHTML": "\n
6546Download
\n" + "innerHTML": "\n
6546Download
\n", + "innerContent": [ + "\n
6546Download
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__file__no-download-button.parsed.json b/test/integration/full-content/fixtures/core__file__no-download-button.parsed.json index 65a2cffa5ec9a..ac019b969423c 100644 --- a/test/integration/full-content/fixtures/core__file__no-download-button.parsed.json +++ b/test/integration/full-content/fixtures/core__file__no-download-button.parsed.json @@ -7,12 +7,18 @@ "id": 176 }, "innerBlocks": [], - "innerHTML": "\n
lkjfijwef
\n" + "innerHTML": "\n
lkjfijwef
\n", + "innerContent": [ + "\n
lkjfijwef
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__file__no-text-link.parsed.json b/test/integration/full-content/fixtures/core__file__no-text-link.parsed.json index 6a891d4ea839c..d70321c12c06d 100644 --- a/test/integration/full-content/fixtures/core__file__no-text-link.parsed.json +++ b/test/integration/full-content/fixtures/core__file__no-text-link.parsed.json @@ -7,12 +7,18 @@ "id": 176 }, "innerBlocks": [], - "innerHTML": "\n
Download
\n" + "innerHTML": "\n
Download
\n", + "innerContent": [ + "\n
Download
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__freeform.parsed.json b/test/integration/full-content/fixtures/core__freeform.parsed.json index 5cf330c0e9e99..1ec86e571b009 100644 --- a/test/integration/full-content/fixtures/core__freeform.parsed.json +++ b/test/integration/full-content/fixtures/core__freeform.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/freeform", "attrs": {}, "innerBlocks": [], - "innerHTML": "\nTesting freeform block with some\n
\n\tHTML content\n
\n" + "innerHTML": "\nTesting freeform block with some\n
\n\tHTML content\n
\n", + "innerContent": [ + "\nTesting freeform block with some\n
\n\tHTML content\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__freeform__undelimited.parsed.json b/test/integration/full-content/fixtures/core__freeform__undelimited.parsed.json index 02999f7b830c4..4aca91e2f3a22 100644 --- a/test/integration/full-content/fixtures/core__freeform__undelimited.parsed.json +++ b/test/integration/full-content/fixtures/core__freeform__undelimited.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "Testing freeform block with some\n
\n\tHTML content\n
\n" + "innerHTML": "Testing freeform block with some\n
\n\tHTML content\n
\n", + "innerContent": [ + "Testing freeform block with some\n
\n\tHTML content\n
\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__gallery.parsed.json b/test/integration/full-content/fixtures/core__gallery.parsed.json index 3d80657c7f204..fc5c9e17d6890 100644 --- a/test/integration/full-content/fixtures/core__gallery.parsed.json +++ b/test/integration/full-content/fixtures/core__gallery.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/gallery", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__gallery__columns.parsed.json b/test/integration/full-content/fixtures/core__gallery__columns.parsed.json index 44faed907a8fc..6f6e4b856d7ec 100644 --- a/test/integration/full-content/fixtures/core__gallery__columns.parsed.json +++ b/test/integration/full-content/fixtures/core__gallery__columns.parsed.json @@ -5,12 +5,18 @@ "columns": 1 }, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__heading__h2-em.parsed.json b/test/integration/full-content/fixtures/core__heading__h2-em.parsed.json index 76d235d42c896..e10209f2270c9 100644 --- a/test/integration/full-content/fixtures/core__heading__h2-em.parsed.json +++ b/test/integration/full-content/fixtures/core__heading__h2-em.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/heading", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

The Inserter Tool

\n" + "innerHTML": "\n

The Inserter Tool

\n", + "innerContent": [ + "\n

The Inserter Tool

\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__heading__h2.parsed.json b/test/integration/full-content/fixtures/core__heading__h2.parsed.json index 700f5f941e3fd..be6bc63b316de 100644 --- a/test/integration/full-content/fixtures/core__heading__h2.parsed.json +++ b/test/integration/full-content/fixtures/core__heading__h2.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/heading", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

A picture is worth a thousand words, or so the saying goes

\n" + "innerHTML": "\n

A picture is worth a thousand words, or so the saying goes

\n", + "innerContent": [ + "\n

A picture is worth a thousand words, or so the saying goes

\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__html.parsed.json b/test/integration/full-content/fixtures/core__html.parsed.json index 2bfdc658667ae..adb0cd44b3367 100644 --- a/test/integration/full-content/fixtures/core__html.parsed.json +++ b/test/integration/full-content/fixtures/core__html.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/html", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

Some HTML code

\nThis text will scroll from right to left\n" + "innerHTML": "\n

Some HTML code

\nThis text will scroll from right to left\n", + "innerContent": [ + "\n

Some HTML code

\nThis text will scroll from right to left\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__image.parsed.json b/test/integration/full-content/fixtures/core__image.parsed.json index fff414d9b01ba..d7e16a440ddef 100644 --- a/test/integration/full-content/fixtures/core__image.parsed.json +++ b/test/integration/full-content/fixtures/core__image.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/image", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__image__attachment-link.parsed.json b/test/integration/full-content/fixtures/core__image__attachment-link.parsed.json index e5da07242d556..fae6604516028 100644 --- a/test/integration/full-content/fixtures/core__image__attachment-link.parsed.json +++ b/test/integration/full-content/fixtures/core__image__attachment-link.parsed.json @@ -5,12 +5,18 @@ "linkDestination": "attachment" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__image__center-caption.parsed.json b/test/integration/full-content/fixtures/core__image__center-caption.parsed.json index 290057c2876a7..02ff95e3ae8cb 100644 --- a/test/integration/full-content/fixtures/core__image__center-caption.parsed.json +++ b/test/integration/full-content/fixtures/core__image__center-caption.parsed.json @@ -5,12 +5,18 @@ "align": "center" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
Give it a try. Press the "really wide" button on the image toolbar.
\n" + "innerHTML": "\n
\"\"
Give it a try. Press the "really wide" button on the image toolbar.
\n", + "innerContent": [ + "\n
\"\"
Give it a try. Press the "really wide" button on the image toolbar.
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__image__custom-link.parsed.json b/test/integration/full-content/fixtures/core__image__custom-link.parsed.json index d814737aaedf2..a3625c6a1f683 100644 --- a/test/integration/full-content/fixtures/core__image__custom-link.parsed.json +++ b/test/integration/full-content/fixtures/core__image__custom-link.parsed.json @@ -5,12 +5,18 @@ "linkDestination": "custom" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__image__media-link.parsed.json b/test/integration/full-content/fixtures/core__image__media-link.parsed.json index 345c5d4e258ed..46458a7eec3d7 100644 --- a/test/integration/full-content/fixtures/core__image__media-link.parsed.json +++ b/test/integration/full-content/fixtures/core__image__media-link.parsed.json @@ -5,12 +5,18 @@ "linkDestination": "media" }, "innerBlocks": [], - "innerHTML": "\n
\"\"
\n" + "innerHTML": "\n
\"\"
\n", + "innerContent": [ + "\n
\"\"
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__invalid-Capitals.parsed.json b/test/integration/full-content/fixtures/core__invalid-Capitals.parsed.json index c17c81b398cf3..cbfafc27db9e9 100644 --- a/test/integration/full-content/fixtures/core__invalid-Capitals.parsed.json +++ b/test/integration/full-content/fixtures/core__invalid-Capitals.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__invalid-special.parsed.json b/test/integration/full-content/fixtures/core__invalid-special.parsed.json index 3198b43be513a..05b96f6deb2fc 100644 --- a/test/integration/full-content/fixtures/core__invalid-special.parsed.json +++ b/test/integration/full-content/fixtures/core__invalid-special.parsed.json @@ -3,6 +3,9 @@ "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__latest-comments.parsed.json b/test/integration/full-content/fixtures/core__latest-comments.parsed.json index 7e8bb541adc0c..b7a0e614220d8 100644 --- a/test/integration/full-content/fixtures/core__latest-comments.parsed.json +++ b/test/integration/full-content/fixtures/core__latest-comments.parsed.json @@ -7,12 +7,16 @@ "displayTimestamp": true }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__latest-posts.parsed.json b/test/integration/full-content/fixtures/core__latest-posts.parsed.json index f1c800291d9bc..4279957a0f5c1 100644 --- a/test/integration/full-content/fixtures/core__latest-posts.parsed.json +++ b/test/integration/full-content/fixtures/core__latest-posts.parsed.json @@ -6,12 +6,16 @@ "displayPostDate": false }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__latest-posts__displayPostDate.parsed.json b/test/integration/full-content/fixtures/core__latest-posts__displayPostDate.parsed.json index a92b392679099..57a36f5dce8b8 100644 --- a/test/integration/full-content/fixtures/core__latest-posts__displayPostDate.parsed.json +++ b/test/integration/full-content/fixtures/core__latest-posts__displayPostDate.parsed.json @@ -6,12 +6,16 @@ "displayPostDate": true }, "innerBlocks": [], - "innerHTML": "" + "innerHTML": "", + "innerContent": [] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__list__ul.parsed.json b/test/integration/full-content/fixtures/core__list__ul.parsed.json index c42181ba553ac..83cb9ff7fc24d 100644 --- a/test/integration/full-content/fixtures/core__list__ul.parsed.json +++ b/test/integration/full-content/fixtures/core__list__ul.parsed.json @@ -3,12 +3,18 @@ "blockName": "core/list", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ + "\n\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__media-text.parsed.json b/test/integration/full-content/fixtures/core__media-text.parsed.json index 82df709985669..ec0bf62e61317 100644 --- a/test/integration/full-content/fixtures/core__media-text.parsed.json +++ b/test/integration/full-content/fixtures/core__media-text.parsed.json @@ -13,15 +13,26 @@ "fontSize": "large" }, "innerBlocks": [], - "innerHTML": "\n\t\t

My Content

\n\t\t" + "innerHTML": "\n\t\t

My Content

\n\t\t", + "innerContent": [ + "\n\t\t

My Content

\n\t\t" + ] } ], - "innerHTML": "\n
\n\t
\n\t\t\"\"/\n\t
\n\t
\n\t\t\n\t
\n
\n" + "innerHTML": "\n
\n\t
\n\t\t\"\"/\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\"\"/\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__media-text__image-alt-no-align.parsed.json b/test/integration/full-content/fixtures/core__media-text__image-alt-no-align.parsed.json index 5e9fc5b3f5e1e..e078f9c6ae589 100644 --- a/test/integration/full-content/fixtures/core__media-text__image-alt-no-align.parsed.json +++ b/test/integration/full-content/fixtures/core__media-text__image-alt-no-align.parsed.json @@ -14,15 +14,26 @@ "fontSize": "large" }, "innerBlocks": [], - "innerHTML": "\n\t\t

Content

\n\t\t" + "innerHTML": "\n\t\t

Content

\n\t\t", + "innerContent": [ + "\n\t\t

Content

\n\t\t" + ] } ], - "innerHTML": "\n
\n\t
\n\t\t\"my\n\t
\n\t
\n\t\t\n\t
\n
\n" + "innerHTML": "\n
\n\t
\n\t\t\"my\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\"my\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__media-text__is-stacked-on-mobile.parsed.json b/test/integration/full-content/fixtures/core__media-text__is-stacked-on-mobile.parsed.json index ae97bce200994..3451267ab6897 100644 --- a/test/integration/full-content/fixtures/core__media-text__is-stacked-on-mobile.parsed.json +++ b/test/integration/full-content/fixtures/core__media-text__is-stacked-on-mobile.parsed.json @@ -14,15 +14,26 @@ "fontSize": "large" }, "innerBlocks": [], - "innerHTML": "\n\t\t

My Content

\n\t\t" + "innerHTML": "\n\t\t

My Content

\n\t\t", + "innerContent": [ + "\n\t\t

My Content

\n\t\t" + ] } ], - "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n" + "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__media-text__media-right-custom-width.parsed.json b/test/integration/full-content/fixtures/core__media-text__media-right-custom-width.parsed.json index d344565dadc83..37484502190c7 100644 --- a/test/integration/full-content/fixtures/core__media-text__media-right-custom-width.parsed.json +++ b/test/integration/full-content/fixtures/core__media-text__media-right-custom-width.parsed.json @@ -17,15 +17,26 @@ "fontSize": "large" }, "innerBlocks": [], - "innerHTML": "\n\t\t

My video

\n\t\t" + "innerHTML": "\n\t\t

My video

\n\t\t", + "innerContent": [ + "\n\t\t

My video

\n\t\t" + ] } ], - "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n" + "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__media-text__video.parsed.json b/test/integration/full-content/fixtures/core__media-text__video.parsed.json index ff58f6ab6c5fd..4e06eb858a520 100644 --- a/test/integration/full-content/fixtures/core__media-text__video.parsed.json +++ b/test/integration/full-content/fixtures/core__media-text__video.parsed.json @@ -13,15 +13,26 @@ "fontSize": "large" }, "innerBlocks": [], - "innerHTML": "\n\t\t

My Content

\n\t\t" + "innerHTML": "\n\t\t

My Content

\n\t\t", + "innerContent": [ + "\n\t\t

My Content

\n\t\t" + ] } ], - "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n" + "innerHTML": "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t\n\t
\n
\n", + "innerContent": [ + "\n
\n\t
\n\t\t\n\t
\n\t
\n\t\t", + null, + "\n\t
\n
\n" + ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ + "\n" + ] } ] diff --git a/test/integration/full-content/fixtures/core__missing.parsed.json b/test/integration/full-content/fixtures/core__missing.parsed.json index 3a559918b6619..85ab1542c72a3 100644 --- a/test/integration/full-content/fixtures/core__missing.parsed.json +++ b/test/integration/full-content/fixtures/core__missing.parsed.json @@ -6,12 +6,14 @@ "attr2": "Two" }, "innerBlocks": [], - "innerHTML": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n" + "innerHTML": "\n

Testing missing block with some

\n
\n\tHTML content\n
\n", + "innerContent": [ "\n

Testing missing block with some

\n
\n\tHTML content\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__more.parsed.json b/test/integration/full-content/fixtures/core__more.parsed.json index 176e7fe7f7c16..b806b0c0af8db 100644 --- a/test/integration/full-content/fixtures/core__more.parsed.json +++ b/test/integration/full-content/fixtures/core__more.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/more", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__more__custom-text-teaser.parsed.json b/test/integration/full-content/fixtures/core__more__custom-text-teaser.parsed.json index a533e3c09c471..e3096b9d7cdbb 100644 --- a/test/integration/full-content/fixtures/core__more__custom-text-teaser.parsed.json +++ b/test/integration/full-content/fixtures/core__more__custom-text-teaser.parsed.json @@ -6,12 +6,14 @@ "noTeaser": true }, "innerBlocks": [], - "innerHTML": "\n\n\n" + "innerHTML": "\n\n\n", + "innerContent": [ "\n\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__nextpage.parsed.json b/test/integration/full-content/fixtures/core__nextpage.parsed.json index e4dd2534c821e..ff3f2703bf69a 100644 --- a/test/integration/full-content/fixtures/core__nextpage.parsed.json +++ b/test/integration/full-content/fixtures/core__nextpage.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/nextpage", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n\n" + "innerHTML": "\n\n", + "innerContent": [ "\n\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__paragraph__align-right.parsed.json b/test/integration/full-content/fixtures/core__paragraph__align-right.parsed.json index 060d40a38de5a..e0c2ab7be237b 100644 --- a/test/integration/full-content/fixtures/core__paragraph__align-right.parsed.json +++ b/test/integration/full-content/fixtures/core__paragraph__align-right.parsed.json @@ -5,12 +5,14 @@ "align": "right" }, "innerBlocks": [], - "innerHTML": "\n

... like this one, which is separate from the above and right aligned.

\n" + "innerHTML": "\n

... like this one, which is separate from the above and right aligned.

\n", + "innerContent": [ "\n

... like this one, which is separate from the above and right aligned.

\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__paragraph__deprecated.parsed.json b/test/integration/full-content/fixtures/core__paragraph__deprecated.parsed.json index ac11af1b3a92c..e6b914e24e111 100644 --- a/test/integration/full-content/fixtures/core__paragraph__deprecated.parsed.json +++ b/test/integration/full-content/fixtures/core__paragraph__deprecated.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/paragraph", "attrs": {}, "innerBlocks": [], - "innerHTML": "\nUnwrapped is still valid.\n" + "innerHTML": "\nUnwrapped is still valid.\n", + "innerContent": [ "\nUnwrapped is still valid.\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__preformatted.parsed.json b/test/integration/full-content/fixtures/core__preformatted.parsed.json index 247fdda2e3eee..c78497076e90d 100644 --- a/test/integration/full-content/fixtures/core__preformatted.parsed.json +++ b/test/integration/full-content/fixtures/core__preformatted.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/preformatted", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
Some preformatted text...
And more!
\n" + "innerHTML": "\n
Some preformatted text...
And more!
\n", + "innerContent": [ "\n
Some preformatted text...
And more!
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__pullquote.parsed.json b/test/integration/full-content/fixtures/core__pullquote.parsed.json index 0e39eea4ec89c..033b311fa5a19 100644 --- a/test/integration/full-content/fixtures/core__pullquote.parsed.json +++ b/test/integration/full-content/fixtures/core__pullquote.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/pullquote", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n
\n

Testing pullquote block...

...with a caption\n
\n
\n" + "innerHTML": "\n
\n
\n

Testing pullquote block...

...with a caption\n
\n
\n", + "innerContent": [ "\n
\n
\n

Testing pullquote block...

...with a caption\n
\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json index 3b303a0d8d157..fe8abfce70a36 100644 --- a/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json +++ b/test/integration/full-content/fixtures/core__pullquote__multi-paragraph.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/pullquote", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n\t
\n
\n" + "innerHTML": "\n
\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n\t
\n
\n", + "innerContent": [ "\n
\n
\n

Paragraph one

\n

Paragraph two

\n by whomever\n\t
\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__quote__style-1.parsed.json b/test/integration/full-content/fixtures/core__quote__style-1.parsed.json index 12f480ef313fe..6a873438f1731 100644 --- a/test/integration/full-content/fixtures/core__quote__style-1.parsed.json +++ b/test/integration/full-content/fixtures/core__quote__style-1.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/quote", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
\n" + "innerHTML": "\n

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
\n", + "innerContent": [ "\n

The editor will endeavour to create a new page and post building experience that makes writing rich posts effortless, and has “blocks” to make it easy what today might take shortcodes, custom HTML, or “mystery meat” embed discovery.

Matt Mullenweg, 2017
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__quote__style-2.parsed.json b/test/integration/full-content/fixtures/core__quote__style-2.parsed.json index 87a9377e2e9ed..6470afbc17a2e 100644 --- a/test/integration/full-content/fixtures/core__quote__style-2.parsed.json +++ b/test/integration/full-content/fixtures/core__quote__style-2.parsed.json @@ -5,12 +5,14 @@ "className": "is-style-large" }, "innerBlocks": [], - "innerHTML": "\n

There is no greater agony than bearing an untold story inside you.

Maya Angelou
\n" + "innerHTML": "\n

There is no greater agony than bearing an untold story inside you.

Maya Angelou
\n", + "innerContent": [ "\n

There is no greater agony than bearing an untold story inside you.

Maya Angelou
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__separator.parsed.json b/test/integration/full-content/fixtures/core__separator.parsed.json index d01eb1eed1f59..48a8e742c35b0 100644 --- a/test/integration/full-content/fixtures/core__separator.parsed.json +++ b/test/integration/full-content/fixtures/core__separator.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/separator", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n" + "innerHTML": "\n
\n", + "innerContent": [ "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__shortcode.parsed.json b/test/integration/full-content/fixtures/core__shortcode.parsed.json index 70d24dc276253..b875770f15a45 100644 --- a/test/integration/full-content/fixtures/core__shortcode.parsed.json +++ b/test/integration/full-content/fixtures/core__shortcode.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/shortcode", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n[gallery ids=\"238,338\"]\n" + "innerHTML": "\n[gallery ids=\"238,338\"]\n", + "innerContent": [ "\n[gallery ids=\"238,338\"]\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__spacer.parsed.json b/test/integration/full-content/fixtures/core__spacer.parsed.json index 8b8baa2a7fc61..c3c0938df5b9d 100644 --- a/test/integration/full-content/fixtures/core__spacer.parsed.json +++ b/test/integration/full-content/fixtures/core__spacer.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/spacer", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n" + "innerHTML": "\n
\n", + "innerContent": [ "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__subhead.parsed.json b/test/integration/full-content/fixtures/core__subhead.parsed.json index 06ca46da1b88d..d88b9ee4c90b6 100644 --- a/test/integration/full-content/fixtures/core__subhead.parsed.json +++ b/test/integration/full-content/fixtures/core__subhead.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/subhead", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

This is a subhead.

\n" + "innerHTML": "\n

This is a subhead.

\n", + "innerContent": [ "\n

This is a subhead.

\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__table.parsed.json b/test/integration/full-content/fixtures/core__table.parsed.json index 8c24b96113b94..7a2d91003f437 100644 --- a/test/integration/full-content/fixtures/core__table.parsed.json +++ b/test/integration/full-content/fixtures/core__table.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/table", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
\n" + "innerHTML": "\n
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
\n", + "innerContent": [ "\n
VersionMusicianDate
.70No musician chosen.May 27, 2003
1.0Miles DavisJanuary 3, 2004
Lots of versions skipped, see the full list
4.4Clifford BrownDecember 8, 2015
4.5Coleman HawkinsApril 12, 2016
4.6Pepper AdamsAugust 16, 2016
4.7Sarah VaughanDecember 6, 2016
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__text-columns.parsed.json b/test/integration/full-content/fixtures/core__text-columns.parsed.json index 293c930ac59e6..1a7db4e09ed3a 100644 --- a/test/integration/full-content/fixtures/core__text-columns.parsed.json +++ b/test/integration/full-content/fixtures/core__text-columns.parsed.json @@ -5,12 +5,14 @@ "width": "center" }, "innerBlocks": [], - "innerHTML": "\n
\n
\n

One

\n
\n
\n

Two

\n
\n
\n" + "innerHTML": "\n
\n
\n

One

\n
\n
\n

Two

\n
\n
\n", + "innerContent": [ "\n
\n
\n

One

\n
\n
\n

Two

\n
\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__text__converts-to-paragraph.parsed.json b/test/integration/full-content/fixtures/core__text__converts-to-paragraph.parsed.json index 958d2a2921327..75a5ca1140907 100644 --- a/test/integration/full-content/fixtures/core__text__converts-to-paragraph.parsed.json +++ b/test/integration/full-content/fixtures/core__text__converts-to-paragraph.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/text", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n

This is an old-style text block. Changed to paragraph in #2135.

\n" + "innerHTML": "\n

This is an old-style text block. Changed to paragraph in #2135.

\n", + "innerContent": [ "\n

This is an old-style text block. Changed to paragraph in #2135.

\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__verse.parsed.json b/test/integration/full-content/fixtures/core__verse.parsed.json index 4f244cb551d50..4cccc9383a50c 100644 --- a/test/integration/full-content/fixtures/core__verse.parsed.json +++ b/test/integration/full-content/fixtures/core__verse.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/verse", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
A verse
And more!
\n" + "innerHTML": "\n
A verse
And more!
\n", + "innerContent": [ "\n
A verse
And more!
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ] diff --git a/test/integration/full-content/fixtures/core__video.parsed.json b/test/integration/full-content/fixtures/core__video.parsed.json index 7b448d6f380d9..e9be9d8a2ea2c 100644 --- a/test/integration/full-content/fixtures/core__video.parsed.json +++ b/test/integration/full-content/fixtures/core__video.parsed.json @@ -3,12 +3,14 @@ "blockName": "core/video", "attrs": {}, "innerBlocks": [], - "innerHTML": "\n
\n" + "innerHTML": "\n
\n", + "innerContent": [ "\n
\n" ] }, { "blockName": null, "attrs": {}, "innerBlocks": [], - "innerHTML": "\n" + "innerHTML": "\n", + "innerContent": [ "\n" ] } ]