@blocknote/core 0.13.2 → 0.13.4

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 (163) hide show
  1. package/dist/blocknote.js +5730 -2891
  2. package/dist/blocknote.js.map +1 -1
  3. package/dist/blocknote.umd.cjs +7 -7
  4. package/dist/blocknote.umd.cjs.map +1 -1
  5. package/dist/style.css +1 -1
  6. package/dist/webpack-stats.json +1 -1
  7. package/package.json +2 -2
  8. package/src/api/exporters/html/__snapshots__/file/basic/external.html +1 -0
  9. package/src/api/exporters/html/__snapshots__/file/basic/internal.html +1 -0
  10. package/src/api/exporters/html/__snapshots__/file/button/external.html +1 -0
  11. package/src/api/exporters/html/__snapshots__/file/button/internal.html +1 -0
  12. package/src/api/exporters/html/__snapshots__/file/nested/external.html +1 -0
  13. package/src/api/exporters/html/__snapshots__/file/nested/internal.html +1 -0
  14. package/src/api/exporters/html/__snapshots__/file/noCaption/external.html +1 -0
  15. package/src/api/exporters/html/__snapshots__/file/noCaption/internal.html +1 -0
  16. package/src/api/exporters/html/__snapshots__/file/noName/external.html +1 -0
  17. package/src/api/exporters/html/__snapshots__/file/noName/internal.html +1 -0
  18. package/src/api/exporters/html/__snapshots__/image/basic/external.html +1 -1
  19. package/src/api/exporters/html/__snapshots__/image/basic/internal.html +1 -1
  20. package/src/api/exporters/html/__snapshots__/image/button/external.html +1 -1
  21. package/src/api/exporters/html/__snapshots__/image/button/internal.html +1 -1
  22. package/src/api/exporters/html/__snapshots__/image/nested/external.html +1 -1
  23. package/src/api/exporters/html/__snapshots__/image/nested/internal.html +1 -1
  24. package/src/api/exporters/html/__snapshots__/image/noCaption/external.html +1 -0
  25. package/src/api/exporters/html/__snapshots__/image/noCaption/internal.html +1 -0
  26. package/src/api/exporters/html/__snapshots__/image/noName/external.html +1 -0
  27. package/src/api/exporters/html/__snapshots__/image/noName/internal.html +1 -0
  28. package/src/api/exporters/html/__snapshots__/image/noPreview/external.html +1 -0
  29. package/src/api/exporters/html/__snapshots__/image/noPreview/internal.html +1 -0
  30. package/src/api/exporters/html/__snapshots__/lists/basic/external.html +1 -0
  31. package/src/api/exporters/html/__snapshots__/lists/basic/internal.html +1 -0
  32. package/src/api/exporters/html/__snapshots__/lists/nested/external.html +1 -0
  33. package/src/api/exporters/html/__snapshots__/lists/nested/internal.html +1 -0
  34. package/src/api/exporters/html/__snapshots__/simpleFile/basic/external.html +1 -0
  35. package/src/api/exporters/html/__snapshots__/simpleFile/basic/internal.html +1 -0
  36. package/src/api/exporters/html/__snapshots__/simpleFile/button/external.html +1 -0
  37. package/src/api/exporters/html/__snapshots__/simpleFile/button/internal.html +1 -0
  38. package/src/api/exporters/html/__snapshots__/simpleFile/nested/external.html +1 -0
  39. package/src/api/exporters/html/__snapshots__/simpleFile/nested/internal.html +1 -0
  40. package/src/api/exporters/html/__snapshots__/simpleImage/basic/external.html +1 -1
  41. package/src/api/exporters/html/__snapshots__/simpleImage/basic/internal.html +1 -1
  42. package/src/api/exporters/html/__snapshots__/simpleImage/button/external.html +1 -1
  43. package/src/api/exporters/html/__snapshots__/simpleImage/button/internal.html +1 -1
  44. package/src/api/exporters/html/__snapshots__/simpleImage/nested/external.html +1 -1
  45. package/src/api/exporters/html/__snapshots__/simpleImage/nested/internal.html +1 -1
  46. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/external.html +1 -0
  47. package/src/api/exporters/html/__snapshots__/simpleImage/noCaption/internal.html +1 -0
  48. package/src/api/exporters/html/__snapshots__/simpleImage/noName/external.html +1 -0
  49. package/src/api/exporters/html/__snapshots__/simpleImage/noName/internal.html +1 -0
  50. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/external.html +1 -0
  51. package/src/api/exporters/html/__snapshots__/simpleImage/noPreview/internal.html +1 -0
  52. package/src/api/exporters/html/externalHTMLExporter.ts +4 -3
  53. package/src/api/exporters/html/util/simplifyBlocksRehypePlugin.ts +1 -1
  54. package/src/api/exporters/markdown/__snapshots__/file/basic/markdown.md +3 -0
  55. package/src/api/exporters/markdown/__snapshots__/file/button/markdown.md +1 -0
  56. package/src/api/exporters/markdown/__snapshots__/file/nested/markdown.md +7 -0
  57. package/src/api/exporters/markdown/__snapshots__/file/noCaption/markdown.md +1 -0
  58. package/src/api/exporters/markdown/__snapshots__/file/noName/markdown.md +3 -0
  59. package/src/api/exporters/markdown/__snapshots__/image/basic/markdown.md +1 -1
  60. package/src/api/exporters/markdown/__snapshots__/image/button/markdown.md +1 -1
  61. package/src/api/exporters/markdown/__snapshots__/image/nested/markdown.md +2 -2
  62. package/src/api/exporters/markdown/__snapshots__/image/noCaption/markdown.md +1 -0
  63. package/src/api/exporters/markdown/__snapshots__/image/noName/markdown.md +3 -0
  64. package/src/api/exporters/markdown/__snapshots__/image/noPreview/markdown.md +3 -0
  65. package/src/api/exporters/markdown/__snapshots__/lists/basic/markdown.md +8 -0
  66. package/src/api/exporters/markdown/__snapshots__/lists/nested/markdown.md +10 -0
  67. package/src/api/exporters/markdown/__snapshots__/simpleFile/basic/markdown.md +3 -0
  68. package/src/api/exporters/markdown/__snapshots__/simpleFile/button/markdown.md +1 -0
  69. package/src/api/exporters/markdown/__snapshots__/simpleFile/nested/markdown.md +7 -0
  70. package/src/api/exporters/markdown/__snapshots__/simpleImage/basic/markdown.md +3 -1
  71. package/src/api/exporters/markdown/__snapshots__/simpleImage/button/markdown.md +1 -0
  72. package/src/api/exporters/markdown/__snapshots__/simpleImage/nested/markdown.md +6 -2
  73. package/src/api/exporters/markdown/__snapshots__/simpleImage/noCaption/markdown.md +1 -0
  74. package/src/api/exporters/markdown/__snapshots__/simpleImage/noName/markdown.md +3 -0
  75. package/src/api/exporters/markdown/__snapshots__/simpleImage/noPreview/markdown.md +3 -0
  76. package/src/api/exporters/markdown/markdownExporter.ts +2 -0
  77. package/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.ts +42 -0
  78. package/src/api/nodeConversions/__snapshots__/nodeConversions.test.ts.snap +262 -4
  79. package/src/api/parsers/html/__snapshots__/paste/list-test.json +74 -2
  80. package/src/api/parsers/html/__snapshots__/paste/parse-basic-block-types.json +3 -1
  81. package/src/api/parsers/html/__snapshots__/paste/parse-fake-image-caption.json +3 -1
  82. package/src/api/parsers/html/__snapshots__/paste/parse-mixed-nested-lists.json +135 -10
  83. package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists-with-paragraphs.json +132 -7
  84. package/src/api/parsers/html/__snapshots__/paste/parse-nested-lists.json +111 -3
  85. package/src/api/parsers/html/parseHTML.test.ts +166 -95
  86. package/src/api/testUtil/cases/customBlocks.ts +82 -33
  87. package/src/api/testUtil/cases/customInlineContent.ts +1 -1
  88. package/src/api/testUtil/cases/customStyles.ts +1 -1
  89. package/src/api/testUtil/cases/defaultSchema.ts +185 -4
  90. package/src/blocks/AudioBlockContent/AudioBlockContent.ts +163 -0
  91. package/src/blocks/AudioBlockContent/audioBlockHelpers.ts +5 -0
  92. package/src/blocks/FileBlockContent/FileBlockContent.ts +120 -0
  93. package/src/blocks/FileBlockContent/fileBlockHelpers.ts +377 -0
  94. package/src/blocks/ImageBlockContent/ImageBlockContent.ts +134 -354
  95. package/src/blocks/ImageBlockContent/imageBlockHelpers.ts +6 -0
  96. package/src/blocks/ListItemBlockContent/BulletListItemBlockContent/BulletListItemBlockContent.ts +3 -0
  97. package/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.ts +266 -0
  98. package/src/blocks/ListItemBlockContent/ListItemKeyboardShortcuts.ts +2 -1
  99. package/src/blocks/ListItemBlockContent/NumberedListItemBlockContent/NumberedListItemBlockContent.ts +1 -0
  100. package/src/blocks/VideoBlockContent/VideoBlockContent.ts +181 -0
  101. package/src/blocks/VideoBlockContent/videoBlockHelpers.ts +6 -0
  102. package/src/blocks/defaultBlockTypeGuards.ts +53 -1
  103. package/src/blocks/defaultBlocks.ts +11 -2
  104. package/src/editor/Block.css +89 -27
  105. package/src/editor/BlockNoteEditor.ts +24 -10
  106. package/src/editor/BlockNoteSchema.ts +12 -3
  107. package/src/editor/transformPasted.ts +2 -1
  108. package/src/extensions/{ImagePanel/ImageToolbarPlugin.ts → FilePanel/FilePanelPlugin.ts} +22 -25
  109. package/src/extensions/FormattingToolbar/FormattingToolbarPlugin.ts +14 -2
  110. package/src/extensions/SuggestionMenu/getDefaultSlashMenuItems.ts +72 -2
  111. package/src/extensions/TableHandles/TableHandlesPlugin.ts +27 -27
  112. package/src/extensions/TextAlignment/TextAlignmentExtension.ts +7 -1
  113. package/src/i18n/locales/en.ts +117 -11
  114. package/src/i18n/locales/fr.ts +118 -11
  115. package/src/i18n/locales/index.ts +8 -2
  116. package/src/i18n/locales/is.ts +295 -0
  117. package/src/i18n/locales/ja.ts +323 -0
  118. package/src/i18n/locales/ko.ts +307 -0
  119. package/src/i18n/locales/nl.ts +108 -8
  120. package/src/i18n/locales/pl.ts +287 -0
  121. package/src/i18n/locales/pt.ts +295 -0
  122. package/src/i18n/locales/vi.ts +295 -0
  123. package/src/i18n/locales/zh.ts +123 -8
  124. package/src/index.ts +9 -2
  125. package/src/pm-nodes/BlockContainer.ts +18 -6
  126. package/src/schema/blocks/createSpec.ts +1 -0
  127. package/src/schema/blocks/internal.ts +10 -0
  128. package/src/schema/blocks/types.ts +40 -5
  129. package/src/util/string.ts +12 -0
  130. package/types/src/api/exporters/markdown/util/addSpacesToCheckboxesRehypePlugin.d.ts +7 -0
  131. package/types/src/api/testUtil/cases/customBlocks.d.ts +272 -54
  132. package/types/src/api/testUtil/cases/customInlineContent.d.ts +222 -16
  133. package/types/src/api/testUtil/cases/customStyles.d.ts +222 -16
  134. package/types/src/blocks/AudioBlockContent/AudioBlockContent.d.ts +101 -0
  135. package/types/src/blocks/AudioBlockContent/audioBlockHelpers.d.ts +3 -0
  136. package/types/src/blocks/FileBlockContent/FileBlockContent.d.ts +93 -0
  137. package/types/src/blocks/FileBlockContent/fileBlockHelpers.d.ts +30 -0
  138. package/types/src/blocks/ImageBlockContent/ImageBlockContent.d.ts +50 -14
  139. package/types/src/blocks/ImageBlockContent/imageBlockHelpers.d.ts +4 -0
  140. package/types/src/blocks/ListItemBlockContent/CheckListItemBlockContent/CheckListItemBlockContent.d.ts +55 -0
  141. package/types/src/blocks/VideoBlockContent/VideoBlockContent.d.ts +129 -0
  142. package/types/src/blocks/VideoBlockContent/videoBlockHelpers.d.ts +4 -0
  143. package/types/src/blocks/defaultBlockTypeGuards.d.ts +6 -1
  144. package/types/src/blocks/defaultBlocks.d.ts +444 -32
  145. package/types/src/editor/BlockNoteEditor.d.ts +12 -5
  146. package/types/src/extensions/{ImagePanel/ImageToolbarPlugin.d.ts → FilePanel/FilePanelPlugin.d.ts} +9 -12
  147. package/types/src/extensions/TableHandles/TableHandlesPlugin.d.ts +1 -1
  148. package/types/src/i18n/locales/en.d.ts +56 -7
  149. package/types/src/i18n/locales/fr.d.ts +2 -184
  150. package/types/src/i18n/locales/index.d.ts +7 -1
  151. package/types/src/i18n/locales/is.d.ts +2 -0
  152. package/types/src/i18n/locales/ja.d.ts +2 -0
  153. package/types/src/i18n/locales/ko.d.ts +2 -0
  154. package/types/src/i18n/locales/pl.d.ts +2 -0
  155. package/types/src/i18n/locales/pt.d.ts +2 -0
  156. package/types/src/i18n/locales/vi.d.ts +2 -0
  157. package/types/src/index.d.ts +8 -2
  158. package/types/src/pm-nodes/BlockContainer.d.ts +1 -1
  159. package/types/src/schema/blocks/internal.d.ts +1 -1
  160. package/types/src/schema/blocks/types.d.ts +25 -1
  161. package/types/src/util/string.d.ts +1 -0
  162. /package/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.ts +0 -0
  163. /package/types/src/blocks/{ImageBlockContent → FileBlockContent}/uploadToTmpFilesDotOrg_DEV_ONLY.d.ts +0 -0
@@ -14,9 +14,26 @@
14
14
  "styles": {}
15
15
  }
16
16
  ],
17
+ "children": []
18
+ },
19
+ {
20
+ "id": "2",
21
+ "type": "bulletListItem",
22
+ "props": {
23
+ "textColor": "default",
24
+ "backgroundColor": "default",
25
+ "textAlignment": "left"
26
+ },
27
+ "content": [
28
+ {
29
+ "type": "text",
30
+ "text": "Bullet List Item",
31
+ "styles": {}
32
+ }
33
+ ],
17
34
  "children": [
18
35
  {
19
- "id": "2",
36
+ "id": "3",
20
37
  "type": "bulletListItem",
21
38
  "props": {
22
39
  "textColor": "default",
@@ -33,7 +50,7 @@
33
50
  "children": []
34
51
  },
35
52
  {
36
- "id": "3",
53
+ "id": "4",
37
54
  "type": "bulletListItem",
38
55
  "props": {
39
56
  "textColor": "default",
@@ -52,7 +69,7 @@
52
69
  ]
53
70
  },
54
71
  {
55
- "id": "4",
72
+ "id": "5",
56
73
  "type": "bulletListItem",
57
74
  "props": {
58
75
  "textColor": "default",
@@ -69,7 +86,24 @@
69
86
  "children": []
70
87
  },
71
88
  {
72
- "id": "5",
89
+ "id": "6",
90
+ "type": "numberedListItem",
91
+ "props": {
92
+ "textColor": "default",
93
+ "backgroundColor": "default",
94
+ "textAlignment": "left"
95
+ },
96
+ "content": [
97
+ {
98
+ "type": "text",
99
+ "text": "Numbered List Item",
100
+ "styles": {}
101
+ }
102
+ ],
103
+ "children": []
104
+ },
105
+ {
106
+ "id": "7",
73
107
  "type": "numberedListItem",
74
108
  "props": {
75
109
  "textColor": "default",
@@ -85,7 +119,7 @@
85
119
  ],
86
120
  "children": [
87
121
  {
88
- "id": "6",
122
+ "id": "8",
89
123
  "type": "numberedListItem",
90
124
  "props": {
91
125
  "textColor": "default",
@@ -102,7 +136,7 @@
102
136
  "children": []
103
137
  },
104
138
  {
105
- "id": "7",
139
+ "id": "9",
106
140
  "type": "numberedListItem",
107
141
  "props": {
108
142
  "textColor": "default",
@@ -121,7 +155,7 @@
121
155
  ]
122
156
  },
123
157
  {
124
- "id": "8",
158
+ "id": "10",
125
159
  "type": "numberedListItem",
126
160
  "props": {
127
161
  "textColor": "default",
@@ -136,5 +170,96 @@
136
170
  }
137
171
  ],
138
172
  "children": []
173
+ },
174
+ {
175
+ "id": "11",
176
+ "type": "checkListItem",
177
+ "props": {
178
+ "textColor": "default",
179
+ "backgroundColor": "default",
180
+ "textAlignment": "left",
181
+ "checked": false
182
+ },
183
+ "content": [
184
+ {
185
+ "type": "text",
186
+ "text": "Checked List Item",
187
+ "styles": {}
188
+ }
189
+ ],
190
+ "children": []
191
+ },
192
+ {
193
+ "id": "12",
194
+ "type": "checkListItem",
195
+ "props": {
196
+ "textColor": "default",
197
+ "backgroundColor": "default",
198
+ "textAlignment": "left",
199
+ "checked": false
200
+ },
201
+ "content": [
202
+ {
203
+ "type": "text",
204
+ "text": "Checked List Item",
205
+ "styles": {}
206
+ }
207
+ ],
208
+ "children": [
209
+ {
210
+ "id": "13",
211
+ "type": "checkListItem",
212
+ "props": {
213
+ "textColor": "default",
214
+ "backgroundColor": "default",
215
+ "textAlignment": "left",
216
+ "checked": false
217
+ },
218
+ "content": [
219
+ {
220
+ "type": "text",
221
+ "text": "Nested Checked List Item",
222
+ "styles": {}
223
+ }
224
+ ],
225
+ "children": []
226
+ },
227
+ {
228
+ "id": "14",
229
+ "type": "checkListItem",
230
+ "props": {
231
+ "textColor": "default",
232
+ "backgroundColor": "default",
233
+ "textAlignment": "left",
234
+ "checked": false
235
+ },
236
+ "content": [
237
+ {
238
+ "type": "text",
239
+ "text": "Nested Checked List Item",
240
+ "styles": {}
241
+ }
242
+ ],
243
+ "children": []
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "id": "15",
249
+ "type": "checkListItem",
250
+ "props": {
251
+ "textColor": "default",
252
+ "backgroundColor": "default",
253
+ "textAlignment": "left",
254
+ "checked": false
255
+ },
256
+ "content": [
257
+ {
258
+ "type": "text",
259
+ "text": "Checked List Item",
260
+ "styles": {}
261
+ }
262
+ ],
263
+ "children": []
139
264
  }
140
265
  ]
@@ -100,9 +100,26 @@
100
100
  "styles": {}
101
101
  }
102
102
  ],
103
+ "children": []
104
+ },
105
+ {
106
+ "id": "7",
107
+ "type": "numberedListItem",
108
+ "props": {
109
+ "textColor": "default",
110
+ "backgroundColor": "default",
111
+ "textAlignment": "left"
112
+ },
113
+ "content": [
114
+ {
115
+ "type": "text",
116
+ "text": "Numbered List Item",
117
+ "styles": {}
118
+ }
119
+ ],
103
120
  "children": [
104
121
  {
105
- "id": "7",
122
+ "id": "8",
106
123
  "type": "numberedListItem",
107
124
  "props": {
108
125
  "textColor": "default",
@@ -119,7 +136,7 @@
119
136
  "children": []
120
137
  },
121
138
  {
122
- "id": "8",
139
+ "id": "9",
123
140
  "type": "numberedListItem",
124
141
  "props": {
125
142
  "textColor": "default",
@@ -138,7 +155,7 @@
138
155
  ]
139
156
  },
140
157
  {
141
- "id": "9",
158
+ "id": "10",
142
159
  "type": "numberedListItem",
143
160
  "props": {
144
161
  "textColor": "default",
@@ -153,5 +170,96 @@
153
170
  }
154
171
  ],
155
172
  "children": []
173
+ },
174
+ {
175
+ "id": "11",
176
+ "type": "checkListItem",
177
+ "props": {
178
+ "textColor": "default",
179
+ "backgroundColor": "default",
180
+ "textAlignment": "left",
181
+ "checked": false
182
+ },
183
+ "content": [
184
+ {
185
+ "type": "text",
186
+ "text": "Check List Item",
187
+ "styles": {}
188
+ }
189
+ ],
190
+ "children": []
191
+ },
192
+ {
193
+ "id": "12",
194
+ "type": "checkListItem",
195
+ "props": {
196
+ "textColor": "default",
197
+ "backgroundColor": "default",
198
+ "textAlignment": "left",
199
+ "checked": false
200
+ },
201
+ "content": [
202
+ {
203
+ "type": "text",
204
+ "text": "Check List Item",
205
+ "styles": {}
206
+ }
207
+ ],
208
+ "children": [
209
+ {
210
+ "id": "13",
211
+ "type": "checkListItem",
212
+ "props": {
213
+ "textColor": "default",
214
+ "backgroundColor": "default",
215
+ "textAlignment": "left",
216
+ "checked": false
217
+ },
218
+ "content": [
219
+ {
220
+ "type": "text",
221
+ "text": "Nested Check List Item",
222
+ "styles": {}
223
+ }
224
+ ],
225
+ "children": []
226
+ },
227
+ {
228
+ "id": "14",
229
+ "type": "checkListItem",
230
+ "props": {
231
+ "textColor": "default",
232
+ "backgroundColor": "default",
233
+ "textAlignment": "left",
234
+ "checked": false
235
+ },
236
+ "content": [
237
+ {
238
+ "type": "text",
239
+ "text": "Nested Check List Item",
240
+ "styles": {}
241
+ }
242
+ ],
243
+ "children": []
244
+ }
245
+ ]
246
+ },
247
+ {
248
+ "id": "15",
249
+ "type": "checkListItem",
250
+ "props": {
251
+ "textColor": "default",
252
+ "backgroundColor": "default",
253
+ "textAlignment": "left",
254
+ "checked": false
255
+ },
256
+ "content": [
257
+ {
258
+ "type": "text",
259
+ "text": "Nested Check List Item",
260
+ "styles": {}
261
+ }
262
+ ],
263
+ "children": []
156
264
  }
157
265
  ]
@@ -76,88 +76,147 @@ describe("Parse HTML", () => {
76
76
 
77
77
  it("list test", async () => {
78
78
  const html = `<ul>
79
- <li>First</li>
80
- <li>Second</li>
81
- <li>Third</li>
82
- <li>Five Parent
83
- <ul>
84
- <li>Child 1</li>
85
- <li>Child 2</li>
86
- </ul>
87
- </li>
88
- </ul>`;
79
+ <li>First</li>
80
+ <li>Second</li>
81
+ <li>Third</li>
82
+ <li>
83
+ <input type="checkbox">
84
+ Fourth
85
+ </li>
86
+ <li>
87
+ <input type="checkbox">
88
+ Fifth
89
+ </li>
90
+ <li>Five Parent
91
+ <ul>
92
+ <li>Child 1</li>
93
+ <li>Child 2</li>
94
+ <li>
95
+ <input type="checkbox">
96
+ Child 3
97
+ </li>
98
+ <li>
99
+ <input type="checkbox">
100
+ Child 4
101
+ </li>
102
+ </ul>
103
+ </li>
104
+ </ul>`;
89
105
  await parseHTMLAndCompareSnapshots(html, "list-test");
90
106
  });
91
107
 
92
108
  it("Parse nested lists", async () => {
93
109
  const html = `<ul>
94
110
  <li>Bullet List Item</li>
95
- <li>Bullet List Item</li>
96
- <ul>
97
- <li>
98
- Nested Bullet List Item
99
- </li>
100
- <li>
101
- Nested Bullet List Item
102
- </li>
103
- </ul>
104
- <li>
105
- Bullet List Item
106
- </li>
111
+ <li>Bullet List Item
112
+ <ul>
113
+ <li>Nested Bullet List Item</li>
114
+ <li>Nested Bullet List Item</li>
115
+ </ul>
116
+ </li>
117
+ <li>Bullet List Item</li>
107
118
  </ul>
108
119
  <ol>
109
- <li>
110
- Numbered List Item
111
- <ol>
112
- <li>
113
- Nested Numbered List Item
114
- </li>
115
- <li>
116
- Nested Numbered List Item
117
- </li>
118
- </ol>
119
- </li>
120
- <li>
121
- Numbered List Item
122
- </li>
123
- </ol>`;
120
+ <li>Numbered List Item</li>
121
+ <li>Numbered List Item
122
+ <ol>
123
+ <li>Nested Numbered List Item</li>
124
+ <li>Nested Numbered List Item</li>
125
+ </ol>
126
+ </li>
127
+ <li>Numbered List Item</li>
128
+ </ol>
129
+ <ul>
130
+ <li>
131
+ <input type="checkbox">
132
+ Check List Item
133
+ </li>
134
+ <li>
135
+ <input type="checkbox">
136
+ Check List Item
137
+ <ul>
138
+ <li>
139
+ <input type="checkbox">
140
+ Nested Check List Item
141
+ </li>
142
+ <li>
143
+ <input type="checkbox">
144
+ Nested Check List Item
145
+ </li>
146
+ </ul>
147
+ </li>
148
+ <li>
149
+ <input type="checkbox">
150
+ Nested Check List Item
151
+ </li>
152
+ </ul>`;
124
153
 
125
154
  await parseHTMLAndCompareSnapshots(html, "parse-nested-lists");
126
155
  });
127
156
 
128
157
  it("Parse nested lists with paragraphs", async () => {
129
158
  const html = `<ul>
130
- <li>
131
- <p>Bullet List Item</p>
132
- <ul>
133
- <li>
134
- <p>Nested Bullet List Item</p>
135
- </li>
136
- <li>
137
- <p>Nested Bullet List Item</p>
138
- </li>
139
- </ul>
140
- </li>
141
- <li>
142
- <p>Bullet List Item</p>
143
- </li>
159
+ <li>
160
+ <p>Bullet List Item</p>
161
+ </li>
162
+ <li>
163
+ <p>Bullet List Item</p>
164
+ <ul>
165
+ <li>
166
+ <p>Nested Bullet List Item</p>
167
+ </li>
168
+ <li>
169
+ <p>Nested Bullet List Item</p>
170
+ </li>
171
+ </ul>
172
+ </li>
173
+ <li>
174
+ <p>Bullet List Item</p>
175
+ </li>
144
176
  </ul>
145
177
  <ol>
146
- <li>
147
- <p>Numbered List Item</p>
148
- <ol>
149
- <li>
150
- <p>Nested Numbered List Item</p>
151
- </li>
152
- <li>
153
- <p>Nested Numbered List Item</p>
154
- </li>
155
- </ol>
156
- </li>
157
- <li>
158
- <p>Numbered List Item</p>
159
- </li>
160
- </ol>`;
178
+ <li>
179
+ <p>Numbered List Item</p>
180
+ </li>
181
+ <li>
182
+ <p>Numbered List Item</p>
183
+ <ol>
184
+ <li>
185
+ <p>Nested Numbered List Item</p>
186
+ </li>
187
+ <li>
188
+ <p>Nested Numbered List Item</p>
189
+ </li>
190
+ </ol>
191
+ </li>
192
+ <li>
193
+ <p>Numbered List Item</p>
194
+ </li>
195
+ </ol>
196
+ <ul>
197
+ <li>
198
+ <input type="checkbox">
199
+ <p>Checked List Item</p>
200
+ </li>
201
+ <li>
202
+ <input type="checkbox">
203
+ <p>Checked List Item</p>
204
+ <ul>
205
+ <li>
206
+ <input type="checkbox">
207
+ <p>Nested Checked List Item</p>
208
+ </li>
209
+ <li>
210
+ <label><input type="checkbox"></label>
211
+ <p>Nested Checked List Item</p>
212
+ </li>
213
+ </ul>
214
+ </li>
215
+ <li>
216
+ <input type="checkbox">
217
+ <p>Checked List Item</p>
218
+ </li>
219
+ </ul>`;
161
220
 
162
221
  await parseHTMLAndCompareSnapshots(
163
222
  html,
@@ -167,37 +226,49 @@ describe("Parse HTML", () => {
167
226
 
168
227
  it("Parse mixed nested lists", async () => {
169
228
  const html = `<ul>
170
- <li>
171
- Bullet List Item
172
- <ol>
173
- <li>
174
- Nested Numbered List Item
175
- </li>
176
- <li>
177
- Nested Numbered List Item
178
- </li>
179
- </ol>
180
- </li>
181
- <li>
182
- Bullet List Item
183
- </li>
229
+ <li>Bullet List Item</li>
230
+ <li>Bullet List Item
231
+ <ol>
232
+ <li>Nested Numbered List Item</li>
233
+ <li>Nested Numbered List Item</li>
234
+ </ol>
235
+ </li>
236
+ <li>Bullet List Item</li>
184
237
  </ul>
185
238
  <ol>
186
- <li>
187
- Numbered List Item
188
- <ul>
189
- <li>
190
- <p>Nested Bullet List Item</p>
191
- </li>
192
- <li>
193
- <p>Nested Bullet List Item</p>
194
- </li>
195
- </ul>
196
- </li>
197
- <li>
198
- Numbered List Item
199
- </li>
200
- </ol>`;
239
+ <li>Numbered List Item</li>
240
+ <li>Numbered List Item
241
+ <ul>
242
+ <li>
243
+ <input type="checkbox" checked>
244
+ Nested Check List Item
245
+ </li>
246
+ <li>
247
+ <input type="checkbox">
248
+ Nested Check List Item
249
+ </li>
250
+ </ul>
251
+ </li>
252
+ <li>Numbered List Item</li>
253
+ </ol>
254
+ <ul>
255
+ <li>
256
+ <input type="checkbox" checked>
257
+ Check List Item
258
+ </li>
259
+ <li>
260
+ <input type="checkbox">
261
+ Check List Item
262
+ <ul>
263
+ <li>Nested Bullet List Item</li>
264
+ <li>Nested Bullet List Item</li>
265
+ </ul>
266
+ </li>
267
+ <li>
268
+ <input type="checkbox" checked>
269
+ Nested Check List Item
270
+ </li>
271
+ </ul>`;
201
272
 
202
273
  await parseHTMLAndCompareSnapshots(html, "parse-mixed-nested-lists");
203
274
  });