@wordpress/block-serialization-default-parser 4.42.6 → 4.42.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/class-wp-block-parser.php +6 -15
- package/package.json +2 -2
|
@@ -48,14 +48,6 @@ class WP_Block_Parser {
|
|
|
48
48
|
*/
|
|
49
49
|
public $stack;
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* Empty associative array, here due to PHP quirks
|
|
53
|
-
*
|
|
54
|
-
* @since 4.4.0
|
|
55
|
-
* @var array empty associative array
|
|
56
|
-
*/
|
|
57
|
-
public $empty_attrs;
|
|
58
|
-
|
|
59
51
|
/**
|
|
60
52
|
* Parses a document and returns a list of block structures
|
|
61
53
|
*
|
|
@@ -69,11 +61,10 @@ class WP_Block_Parser {
|
|
|
69
61
|
* @return array[]
|
|
70
62
|
*/
|
|
71
63
|
public function parse( $document ) {
|
|
72
|
-
$this->document
|
|
73
|
-
$this->offset
|
|
74
|
-
$this->output
|
|
75
|
-
$this->stack
|
|
76
|
-
$this->empty_attrs = array();
|
|
64
|
+
$this->document = $document;
|
|
65
|
+
$this->offset = 0;
|
|
66
|
+
$this->output = array();
|
|
67
|
+
$this->stack = array();
|
|
77
68
|
|
|
78
69
|
while ( $this->proceed() ) {
|
|
79
70
|
continue;
|
|
@@ -287,7 +278,7 @@ class WP_Block_Parser {
|
|
|
287
278
|
*/
|
|
288
279
|
$attrs = $has_attrs
|
|
289
280
|
? json_decode( $matches['attrs'][0], /* as-associative */ true )
|
|
290
|
-
:
|
|
281
|
+
: array();
|
|
291
282
|
|
|
292
283
|
/*
|
|
293
284
|
* This state isn't allowed
|
|
@@ -318,7 +309,7 @@ class WP_Block_Parser {
|
|
|
318
309
|
* @return WP_Block_Parser_Block freeform block object.
|
|
319
310
|
*/
|
|
320
311
|
public function freeform( $inner_html ) {
|
|
321
|
-
return new WP_Block_Parser_Block( null,
|
|
312
|
+
return new WP_Block_Parser_Block( null, array(), array(), $inner_html, array( $inner_html ) );
|
|
322
313
|
}
|
|
323
314
|
|
|
324
315
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-serialization-default-parser",
|
|
3
|
-
"version": "4.42.
|
|
3
|
+
"version": "4.42.8",
|
|
4
4
|
"description": "Block serialization specification parser for WordPress posts.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "9ef7560ce92c4736819b5e767810b9a80d51d030"
|
|
37
37
|
}
|