Skip to content

Commit

Permalink
Don't assign block name to freeform units
Browse files Browse the repository at this point in the history
  • Loading branch information
mcsf committed Oct 3, 2018
1 parent 783adcb commit c2cc5bc
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/blocks.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function gutenberg_parse_blocks( $content ) {
if ( ! has_blocks( $content ) ) {
return array(
array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $content,
Expand Down
6 changes: 3 additions & 3 deletions lib/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -1462,7 +1462,7 @@ function peg_join_blocks( $pre, $tokens, $post ) {

if ( ! empty( $pre ) ) {
$blocks[] = array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $pre
Expand All @@ -1476,7 +1476,7 @@ function peg_join_blocks( $pre, $tokens, $post ) {

if ( ! empty( $html ) ) {
$blocks[] = array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $html
Expand All @@ -1486,7 +1486,7 @@ function peg_join_blocks( $pre, $tokens, $post ) {

if ( ! empty( $post ) ) {
$blocks[] = array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $post
Expand Down
2 changes: 1 addition & 1 deletion packages/block-serialization-default-parser/parser.php
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ function next_token() {
* @return WP_Block_Parser_Block freeform block object
*/
static function freeform( $innerHTML ) {
return new WP_Block_Parser_Block( 'core/freeform', array(), array(), $innerHTML );
return new WP_Block_Parser_Block( null, array(), array(), $innerHTML );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/block-serialization-default-parser/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Block( blockName, attrs, innerBlocks, innerHTML ) {
}

function Freeform( innerHTML ) {
return Block( 'core/freeform', {}, [], innerHTML );
return Block( null, {}, [], innerHTML );
}

function Frame( block, tokenStart, tokenLength, prevOffset, leadingHtmlStart ) {
Expand Down
8 changes: 4 additions & 4 deletions packages/block-serialization-spec-parser/grammar.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ if ( ! function_exists( 'peg_join_blocks' ) ) {
if ( ! empty( $pre ) ) {
$blocks[] = array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $pre
Expand All @@ -86,7 +86,7 @@ if ( ! function_exists( 'peg_join_blocks' ) ) {
if ( ! empty( $html ) ) {
$blocks[] = array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $html
Expand All @@ -96,7 +96,7 @@ if ( ! function_exists( 'peg_join_blocks' ) ) {
if ( ! empty( $post ) ) {
$blocks[] = array(
'blockName' => 'core/freeform',
'blockName' => null,
'attrs' => array(),
'innerBlocks' => array(),
'innerHTML' => $post
Expand All @@ -111,7 +111,7 @@ if ( ! function_exists( 'peg_join_blocks' ) ) {

function freeform( s ) {
return s.length && {
blockName: 'core/freeform',
blockName: null,
attrs: {},
innerBlocks: [],
innerHTML: s,
Expand Down
8 changes: 4 additions & 4 deletions packages/block-serialization-spec-parser/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c2cc5bc

Please sign in to comment.