Changeset 44118 for trunk/src/wp-includes/class-wp-block-parser.php
- Timestamp:
- 12/13/2018 06:11:10 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43752
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/class-wp-block-parser.php
r44117 r44118 311 311 * block and add it as a new innerBlock to the parent 312 312 */ 313 $stack_top = array_pop( $this->stack ); 314 $stack_top->block->innerHTML .= substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); 315 $stack_top->prev_offset = $start_offset + $token_length; 313 $stack_top = array_pop( $this->stack ); 314 315 $html = substr( $this->document, $stack_top->prev_offset, $start_offset - $stack_top->prev_offset ); 316 if ( $stack_top->block->innerBlocks ) { 317 $stack_top->block->innerBlocks[] = (array) $this->freeform( $html ); 318 } else { 319 $stack_top->block->innerHTML = $html; 320 } 321 322 $stack_top->prev_offset = $start_offset + $token_length; 316 323 317 324 $this->add_inner_block( … … 446 453 function add_inner_block( WP_Block_Parser_Block $block, $token_start, $token_length, $last_offset = null ) { 447 454 $parent = $this->stack[ count( $this->stack ) - 1 ]; 448 $parent->block->innerBlocks[] = $block;449 $parent->block->inner HTML .= substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset );455 $parent->block->innerBlocks[] = (array) $this->freeform( substr( $this->document, $parent->prev_offset, $token_start - $parent->prev_offset ) ); 456 $parent->block->innerBlocks[] = (array) $block; 450 457 $parent->prev_offset = $last_offset ? $last_offset : $token_start + $token_length; 451 458 } … … 462 469 $prev_offset = $stack_top->prev_offset; 463 470 464 $ stack_top->block->innerHTML .= isset( $end_offset )471 $html = isset( $end_offset ) 465 472 ? substr( $this->document, $prev_offset, $end_offset - $prev_offset ) 466 473 : substr( $this->document, $prev_offset ); 474 475 if ( $stack_top->block->innerBlocks ) { 476 $stack_top->block->innerBlocks[] = (array) $this->freeform( $html ); 477 } else { 478 $stack_top->block->innerHTML = $html; 479 } 467 480 468 481 if ( isset( $stack_top->leading_html_start ) ) {
Note: See TracChangeset
for help on using the changeset viewer.