@wordpress/block-serialization-default-parser 4.2.0 → 4.2.2

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.
Files changed (2) hide show
  1. package/README.md +67 -60
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -10,7 +10,7 @@ Install the module
10
10
  npm install @wordpress/block-serialization-default-parser --save
11
11
  ```
12
12
 
13
- _This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as IE browsers then using [core-js](https://github.com/zloirock/core-js) will add polyfills for these methods._
13
+ _This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for such language features and APIs, you should include [the polyfill shipped in `@wordpress/babel-preset-default`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/babel-preset-default#polyfill) in your code._
14
14
 
15
15
  ## API
16
16
 
@@ -26,21 +26,27 @@ Input post:
26
26
 
27
27
  ```html
28
28
  <!-- wp:columns {"columns":3} -->
29
- <div class="wp-block-columns has-3-columns"><!-- wp:column -->
30
- <div class="wp-block-column"><!-- wp:paragraph -->
31
- <p>Left</p>
32
- <!-- /wp:paragraph --></div>
33
- <!-- /wp:column -->
34
-
35
- <!-- wp:column -->
36
- <div class="wp-block-column"><!-- wp:paragraph -->
37
- <p><strong>Middle</strong></p>
38
- <!-- /wp:paragraph --></div>
39
- <!-- /wp:column -->
40
-
41
- <!-- wp:column -->
42
- <div class="wp-block-column"></div>
43
- <!-- /wp:column --></div>
29
+ <div class="wp-block-columns has-3-columns">
30
+ <!-- wp:column -->
31
+ <div class="wp-block-column">
32
+ <!-- wp:paragraph -->
33
+ <p>Left</p>
34
+ <!-- /wp:paragraph -->
35
+ </div>
36
+ <!-- /wp:column -->
37
+
38
+ <!-- wp:column -->
39
+ <div class="wp-block-column">
40
+ <!-- wp:paragraph -->
41
+ <p><strong>Middle</strong></p>
42
+ <!-- /wp:paragraph -->
43
+ </div>
44
+ <!-- /wp:column -->
45
+
46
+ <!-- wp:column -->
47
+ <div class="wp-block-column"></div>
48
+ <!-- /wp:column -->
49
+ </div>
44
50
  <!-- /wp:columns -->
45
51
  ```
46
52
 
@@ -49,49 +55,51 @@ Parsing code:
49
55
  ```js
50
56
  import { parse } from '@wordpress/block-serialization-default-parser';
51
57
 
52
- parse( post ) === [
53
- {
54
- blockName: "core/columns",
55
- attrs: {
56
- columns: 3
57
- },
58
- innerBlocks: [
59
- {
60
- blockName: "core/column",
61
- attrs: null,
62
- innerBlocks: [
63
- {
64
- blockName: "core/paragraph",
65
- attrs: null,
66
- innerBlocks: [],
67
- innerHTML: "\n<p>Left</p>\n"
68
- }
69
- ],
70
- innerHTML: '\n<div class="wp-block-column"></div>\n'
71
- },
72
- {
73
- blockName: "core/column",
74
- attrs: null,
75
- innerBlocks: [
76
- {
77
- blockName: "core/paragraph",
78
- attrs: null,
79
- innerBlocks: [],
80
- innerHTML: "\n<p><strong>Middle</strong></p>\n"
81
- }
82
- ],
83
- innerHTML: '\n<div class="wp-block-column"></div>\n'
84
- },
85
- {
86
- blockName: "core/column",
87
- attrs: null,
88
- innerBlocks: [],
89
- innerHTML: '\n<div class="wp-block-column"></div>\n'
90
- }
91
- ],
92
- innerHTML: '\n<div class="wp-block-columns has-3-columns">\n\n\n\n</div>\n'
93
- }
94
- ];
58
+ parse( post ) ===
59
+ [
60
+ {
61
+ blockName: 'core/columns',
62
+ attrs: {
63
+ columns: 3,
64
+ },
65
+ innerBlocks: [
66
+ {
67
+ blockName: 'core/column',
68
+ attrs: null,
69
+ innerBlocks: [
70
+ {
71
+ blockName: 'core/paragraph',
72
+ attrs: null,
73
+ innerBlocks: [],
74
+ innerHTML: '\n<p>Left</p>\n',
75
+ },
76
+ ],
77
+ innerHTML: '\n<div class="wp-block-column"></div>\n',
78
+ },
79
+ {
80
+ blockName: 'core/column',
81
+ attrs: null,
82
+ innerBlocks: [
83
+ {
84
+ blockName: 'core/paragraph',
85
+ attrs: null,
86
+ innerBlocks: [],
87
+ innerHTML: '\n<p><strong>Middle</strong></p>\n',
88
+ },
89
+ ],
90
+ innerHTML: '\n<div class="wp-block-column"></div>\n',
91
+ },
92
+ {
93
+ blockName: 'core/column',
94
+ attrs: null,
95
+ innerBlocks: [],
96
+ innerHTML: '\n<div class="wp-block-column"></div>\n',
97
+ },
98
+ ],
99
+ innerHTML:
100
+ '\n<div class="wp-block-columns has-3-columns">\n\n\n\n</div>\n',
101
+ },
102
+ ];
95
103
  ```
96
104
 
97
105
  _Parameters_
@@ -102,7 +110,6 @@ _Returns_
102
110
 
103
111
  - `Array`: A block-based representation of the input HTML.
104
112
 
105
-
106
113
  <!-- END TOKEN(Autogenerated API docs) -->
107
114
 
108
115
  ## Theory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-serialization-default-parser",
3
- "version": "4.2.0",
3
+ "version": "4.2.2",
4
4
  "description": "Block serialization specification parser for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,5 +32,5 @@
32
32
  "publishConfig": {
33
33
  "access": "public"
34
34
  },
35
- "gitHead": "743b70f86f1e75fd66a583bf659f2b2fe5daf1cc"
35
+ "gitHead": "8f7f052bc04e3f4eb50f479ced14be1489b9fa79"
36
36
  }