Skip to content

Commit

Permalink
fix that thing there the default parser was broken
Browse files Browse the repository at this point in the history
  • Loading branch information
dmsnell committed Nov 3, 2018
1 parent 8b6c4be commit 36d8916
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion packages/block-serialization-default-parser/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,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(
Expand Down
7 changes: 3 additions & 4 deletions packages/block-serialization-default-parser/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,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(
Expand Down

0 comments on commit 36d8916

Please sign in to comment.