@zipify/wysiwyg 1.0.0-dev.4 → 1.0.0-dev.7
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/.eslintignore +1 -0
- package/.release-it.json +0 -1
- package/.stylelintignore +1 -0
- package/README.md +3 -1
- package/config/jest/setupTests.js +7 -1
- package/config/webpack/example.config.js +2 -0
- package/config/webpack/lib.config.js +40 -0
- package/config/webpack/loaders/style-loader.js +3 -1
- package/config/webpack/loaders/svg-loader.js +1 -1
- package/dist/wysiwyg.css +837 -0
- package/dist/wysiwyg.js +2 -0
- package/dist/wysiwyg.js.LICENSE.txt +1 -0
- package/example/ExampleApp.vue +39 -31
- package/example/example.js +26 -0
- package/example/presets.js +2 -0
- package/lib/Wysiwyg.vue +6 -0
- package/lib/assets/icons/alignment-center.svg +3 -0
- package/lib/assets/icons/alignment-justify.svg +3 -0
- package/lib/assets/icons/alignment-left.svg +3 -0
- package/lib/assets/icons/alignment-right.svg +3 -0
- package/lib/assets/icons/arrow.svg +3 -0
- package/lib/assets/icons/background-color.svg +3 -0
- package/lib/assets/icons/case-style.svg +3 -0
- package/lib/assets/icons/font-color.svg +5 -0
- package/lib/assets/icons/italic.svg +3 -0
- package/lib/assets/icons/line-height.svg +3 -0
- package/lib/assets/icons/list-circle.svg +3 -0
- package/lib/assets/icons/list-decimal.svg +3 -0
- package/lib/assets/icons/list-disc.svg +3 -0
- package/lib/assets/icons/list-latin.svg +3 -0
- package/lib/assets/icons/list-roman.svg +3 -0
- package/lib/assets/icons/list-square.svg +3 -0
- package/lib/assets/icons/remove-format.svg +3 -0
- package/lib/assets/icons/reset-styles.svg +3 -0
- package/lib/assets/icons/strike-through.svg +3 -0
- package/lib/assets/icons/superscript.svg +3 -0
- package/lib/assets/icons/underline.svg +3 -0
- package/lib/components/base/Icon.vue +17 -9
- package/lib/components/base/__tests__/Icon.test.js +6 -13
- package/lib/composables/__tests__/useEditor.test.js +12 -3
- package/lib/composables/useEditor.js +12 -5
- package/lib/extensions/Alignment.js +6 -0
- package/lib/extensions/BackgroundColor.js +8 -1
- package/lib/extensions/FontColor.js +8 -1
- package/lib/extensions/FontFamily.js +7 -0
- package/lib/extensions/FontSize.js +12 -0
- package/lib/extensions/FontStyle.js +11 -0
- package/lib/extensions/FontWeight.js +25 -1
- package/lib/extensions/LineHeight.js +17 -0
- package/lib/extensions/StylePreset.js +30 -3
- package/lib/extensions/TextDecoration.js +11 -0
- package/lib/extensions/__tests__/Alignment.test.js +22 -1
- package/lib/extensions/__tests__/BackgroundColor.test.js +30 -1
- package/lib/extensions/__tests__/CaseStyle.test.js +4 -1
- package/lib/extensions/__tests__/FontColor.test.js +30 -1
- package/lib/extensions/__tests__/FontFamily.test.js +30 -1
- package/lib/extensions/__tests__/FontSize.test.js +30 -1
- package/lib/extensions/__tests__/FontStyle.test.js +38 -1
- package/lib/extensions/__tests__/FontWeight.test.js +58 -1
- package/lib/extensions/__tests__/LineHeight.test.js +41 -1
- package/lib/extensions/__tests__/StylePreset.test.js +76 -1
- package/lib/extensions/__tests__/TextDecoration.test.js +63 -1
- package/lib/extensions/__tests__/__snapshots__/Alignment.test.js.snap +44 -0
- package/lib/extensions/__tests__/__snapshots__/BackgroundColor.test.js.snap +91 -0
- package/lib/extensions/__tests__/__snapshots__/FontColor.test.js.snap +91 -0
- package/lib/extensions/__tests__/__snapshots__/FontFamily.test.js.snap +91 -0
- package/lib/extensions/__tests__/__snapshots__/FontSize.test.js.snap +99 -0
- package/lib/extensions/__tests__/__snapshots__/FontStyle.test.js.snap +120 -0
- package/lib/extensions/__tests__/__snapshots__/FontWeight.test.js.snap +149 -0
- package/lib/extensions/__tests__/__snapshots__/LineHeight.test.js.snap +92 -0
- package/lib/extensions/__tests__/__snapshots__/StylePreset.test.js.snap +167 -2
- package/lib/extensions/__tests__/__snapshots__/TextDecoration.test.js.snap +207 -0
- package/lib/extensions/core/__tests__/NodeProcessor.test.js +4 -1
- package/lib/extensions/core/__tests__/SelectionProcessor.test.js +9 -4
- package/lib/extensions/core/__tests__/TextProcessor.test.js +4 -1
- package/lib/extensions/index.js +1 -0
- package/lib/extensions/list/List.js +34 -0
- package/lib/extensions/list/__tests__/List.test.js +115 -3
- package/lib/extensions/list/__tests__/__snapshots__/List.test.js.snap +457 -6
- package/lib/services/ContentNormalizer.js +113 -0
- package/lib/services/Storage.js +1 -13
- package/lib/services/__tests__/ContentNormalizer.test.js +41 -0
- package/lib/services/__tests__/FavoriteColors.test.js +20 -0
- package/lib/services/__tests__/JsonSerializer.test.js +23 -0
- package/lib/services/__tests__/Storage.test.js +79 -0
- package/lib/services/index.js +1 -0
- package/lib/utils/__tests__/convertColor.test.js +19 -0
- package/lib/utils/__tests__/createKeyboardShortcut.test.js +25 -0
- package/lib/utils/__tests__/renderInlineSetting.test.js +26 -0
- package/lib/utils/convertColor.js +7 -0
- package/lib/utils/importIcon.js +12 -0
- package/lib/utils/index.js +2 -0
- package/lib/utils/renderInlineSetting.js +1 -1
- package/package.json +5 -6
- package/lib/assets/icons.svg +0 -69
package/lib/extensions/index.js
CHANGED
|
@@ -22,6 +22,7 @@ export const getExtensions = (options) => CORE_EXTENSIONS.concat([
|
|
|
22
22
|
StylePreset.configure({
|
|
23
23
|
presetsRef: options.presetsRef,
|
|
24
24
|
defaultId: options.defaultPresetId,
|
|
25
|
+
baseClass: options.basePresetClass,
|
|
25
26
|
makeVariable: options.makePresetVariable
|
|
26
27
|
}),
|
|
27
28
|
List.configure({
|
|
@@ -21,6 +21,40 @@ export const List = Node.create({
|
|
|
21
21
|
bullet: { isRequired: true }
|
|
22
22
|
}),
|
|
23
23
|
|
|
24
|
+
parseHTML() {
|
|
25
|
+
const HTML_TYPES = {
|
|
26
|
+
a: ListTypes.ROMAN,
|
|
27
|
+
i: ListTypes.LATIN,
|
|
28
|
+
'1': ListTypes.DECIMAL
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
const getBulletType = (element) => {
|
|
32
|
+
for (const type of ListTypes.values) {
|
|
33
|
+
const bulletClass = `.${this.options.baseClass}${type}`;
|
|
34
|
+
|
|
35
|
+
if (element.matches(bulletClass)) return type;
|
|
36
|
+
if (HTML_TYPES[element.type.toLowerCase()] === type) return type;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
return [
|
|
41
|
+
{
|
|
42
|
+
tag: 'ol',
|
|
43
|
+
|
|
44
|
+
getAttrs: (element) => ({
|
|
45
|
+
bullet: { type: getBulletType(element) || ListTypes.DECIMAL }
|
|
46
|
+
})
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
tag: 'ul',
|
|
50
|
+
|
|
51
|
+
getAttrs: (element) => ({
|
|
52
|
+
bullet: { type: getBulletType(element) || ListTypes.DISC }
|
|
53
|
+
})
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
},
|
|
57
|
+
|
|
24
58
|
renderHTML({ HTMLAttributes: attrs }) {
|
|
25
59
|
const isOrdered = ListTypes.ordered.includes(attrs.bullet.type);
|
|
26
60
|
const tag = isOrdered ? 'ol' : 'ul';
|
|
@@ -5,13 +5,18 @@ import { ListTypes } from '../../../enums';
|
|
|
5
5
|
import { CORE_EXTENSIONS } from '../../core';
|
|
6
6
|
import { StylePreset } from '../../StylePreset';
|
|
7
7
|
import { List } from '../List';
|
|
8
|
+
import { ContentNormalizer } from '../../../services';
|
|
8
9
|
|
|
9
10
|
function createEditor({ content }) {
|
|
11
|
+
const normalizer = new ContentNormalizer();
|
|
12
|
+
|
|
10
13
|
return new Editor({
|
|
11
|
-
content,
|
|
14
|
+
content: normalizer.normalize(content),
|
|
12
15
|
element: document.createElement('div'),
|
|
13
16
|
extensions: CORE_EXTENSIONS.concat(
|
|
14
|
-
List
|
|
17
|
+
List.configure({
|
|
18
|
+
baseClass: 'zw-list--'
|
|
19
|
+
}),
|
|
15
20
|
StylePreset.configure({
|
|
16
21
|
presetsRef: ref([
|
|
17
22
|
{
|
|
@@ -22,7 +27,8 @@ function createEditor({ content }) {
|
|
|
22
27
|
desktop: {}
|
|
23
28
|
}
|
|
24
29
|
]),
|
|
25
|
-
defaultId: 'regular-1'
|
|
30
|
+
defaultId: 'regular-1',
|
|
31
|
+
baseClass: 'zw ts-'
|
|
26
32
|
})
|
|
27
33
|
)
|
|
28
34
|
});
|
|
@@ -128,3 +134,109 @@ describe('apply list', () => {
|
|
|
128
134
|
expect(editor.getJSON()).toMatchSnapshot();
|
|
129
135
|
});
|
|
130
136
|
});
|
|
137
|
+
|
|
138
|
+
describe('parsing html', () => {
|
|
139
|
+
test('should parse disc type by class', () => {
|
|
140
|
+
const editor = createEditor({
|
|
141
|
+
content: '<ul class="zw-list--disc"><li>lorem ipsum</li></ul>'
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
test('should parse disc as default', () => {
|
|
148
|
+
const editor = createEditor({
|
|
149
|
+
content: '<ul><li>lorem ipsum</li></ul>'
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
test('should parse circle type by class', () => {
|
|
156
|
+
const editor = createEditor({
|
|
157
|
+
content: '<ul class="zw-list--circle"><li>lorem ipsum</li></ul>'
|
|
158
|
+
});
|
|
159
|
+
|
|
160
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('should parse square type by class', () => {
|
|
164
|
+
const editor = createEditor({
|
|
165
|
+
content: '<ul class="zw-list--square"><li>lorem ipsum</li></ul>'
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
test('should parse decimal type by class', () => {
|
|
172
|
+
const editor = createEditor({
|
|
173
|
+
content: '<ol class="zw-list--decimal"><li>lorem ipsum</li></ol>'
|
|
174
|
+
});
|
|
175
|
+
|
|
176
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
test('should parse decimal as default', () => {
|
|
180
|
+
const editor = createEditor({
|
|
181
|
+
content: '<ol><li>lorem ipsum</li></ol>'
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
test('should parse decimal type by attribute', () => {
|
|
188
|
+
const editor = createEditor({
|
|
189
|
+
content: '<ol type="1"><li>lorem ipsum</li></ol>'
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
test('should parse roman type by class', () => {
|
|
196
|
+
const editor = createEditor({
|
|
197
|
+
content: '<ol class="zw-list--roman"><li>lorem ipsum</li></ol>'
|
|
198
|
+
});
|
|
199
|
+
|
|
200
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
201
|
+
});
|
|
202
|
+
|
|
203
|
+
test('should parse roman type by lower attribute', () => {
|
|
204
|
+
const editor = createEditor({
|
|
205
|
+
content: '<ol type="a"><li>lorem ipsum</li></ol>'
|
|
206
|
+
});
|
|
207
|
+
|
|
208
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
test('should parse roman type by upper attribute', () => {
|
|
212
|
+
const editor = createEditor({
|
|
213
|
+
content: '<ol type="A"><li>lorem ipsum</li></ol>'
|
|
214
|
+
});
|
|
215
|
+
|
|
216
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
test('should parse latin type by class', () => {
|
|
220
|
+
const editor = createEditor({
|
|
221
|
+
content: '<ol class="zw-list--latin"><li>lorem ipsum</li></ol>'
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
225
|
+
});
|
|
226
|
+
|
|
227
|
+
test('should parse latin type by lower attribute', () => {
|
|
228
|
+
const editor = createEditor({
|
|
229
|
+
content: '<ol type="i"><li>lorem ipsum</li></ol>'
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test('should parse latin type by upper attribute', () => {
|
|
236
|
+
const editor = createEditor({
|
|
237
|
+
content: '<ol type="I"><li>lorem ipsum</li></ol>'
|
|
238
|
+
});
|
|
239
|
+
|
|
240
|
+
expect(editor.getJSON()).toMatchSnapshot();
|
|
241
|
+
});
|
|
242
|
+
});
|
|
@@ -92,9 +92,7 @@ Object {
|
|
|
92
92
|
"content": Array [
|
|
93
93
|
Object {
|
|
94
94
|
"attrs": Object {
|
|
95
|
-
"preset":
|
|
96
|
-
"id": "regular-1",
|
|
97
|
-
},
|
|
95
|
+
"preset": null,
|
|
98
96
|
},
|
|
99
97
|
"content": Array [
|
|
100
98
|
Object {
|
|
@@ -106,9 +104,7 @@ Object {
|
|
|
106
104
|
},
|
|
107
105
|
Object {
|
|
108
106
|
"attrs": Object {
|
|
109
|
-
"preset":
|
|
110
|
-
"id": "regular-1",
|
|
111
|
-
},
|
|
107
|
+
"preset": null,
|
|
112
108
|
},
|
|
113
109
|
"content": Array [
|
|
114
110
|
Object {
|
|
@@ -210,3 +206,458 @@ Object {
|
|
|
210
206
|
"type": "doc",
|
|
211
207
|
}
|
|
212
208
|
`;
|
|
209
|
+
|
|
210
|
+
exports[`parsing html should parse circle type by class 1`] = `
|
|
211
|
+
Object {
|
|
212
|
+
"content": Array [
|
|
213
|
+
Object {
|
|
214
|
+
"attrs": Object {
|
|
215
|
+
"bullet": Object {
|
|
216
|
+
"type": "circle",
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
"content": Array [
|
|
220
|
+
Object {
|
|
221
|
+
"content": Array [
|
|
222
|
+
Object {
|
|
223
|
+
"attrs": Object {
|
|
224
|
+
"preset": null,
|
|
225
|
+
},
|
|
226
|
+
"content": Array [
|
|
227
|
+
Object {
|
|
228
|
+
"text": "lorem ipsum",
|
|
229
|
+
"type": "text",
|
|
230
|
+
},
|
|
231
|
+
],
|
|
232
|
+
"type": "paragraph",
|
|
233
|
+
},
|
|
234
|
+
],
|
|
235
|
+
"type": "listItem",
|
|
236
|
+
},
|
|
237
|
+
],
|
|
238
|
+
"type": "list",
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
"type": "doc",
|
|
242
|
+
}
|
|
243
|
+
`;
|
|
244
|
+
|
|
245
|
+
exports[`parsing html should parse decimal as default 1`] = `
|
|
246
|
+
Object {
|
|
247
|
+
"content": Array [
|
|
248
|
+
Object {
|
|
249
|
+
"attrs": Object {
|
|
250
|
+
"bullet": Object {
|
|
251
|
+
"type": "decimal",
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
"content": Array [
|
|
255
|
+
Object {
|
|
256
|
+
"content": Array [
|
|
257
|
+
Object {
|
|
258
|
+
"attrs": Object {
|
|
259
|
+
"preset": null,
|
|
260
|
+
},
|
|
261
|
+
"content": Array [
|
|
262
|
+
Object {
|
|
263
|
+
"text": "lorem ipsum",
|
|
264
|
+
"type": "text",
|
|
265
|
+
},
|
|
266
|
+
],
|
|
267
|
+
"type": "paragraph",
|
|
268
|
+
},
|
|
269
|
+
],
|
|
270
|
+
"type": "listItem",
|
|
271
|
+
},
|
|
272
|
+
],
|
|
273
|
+
"type": "list",
|
|
274
|
+
},
|
|
275
|
+
],
|
|
276
|
+
"type": "doc",
|
|
277
|
+
}
|
|
278
|
+
`;
|
|
279
|
+
|
|
280
|
+
exports[`parsing html should parse decimal type by attribute 1`] = `
|
|
281
|
+
Object {
|
|
282
|
+
"content": Array [
|
|
283
|
+
Object {
|
|
284
|
+
"attrs": Object {
|
|
285
|
+
"bullet": Object {
|
|
286
|
+
"type": "decimal",
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
"content": Array [
|
|
290
|
+
Object {
|
|
291
|
+
"content": Array [
|
|
292
|
+
Object {
|
|
293
|
+
"attrs": Object {
|
|
294
|
+
"preset": null,
|
|
295
|
+
},
|
|
296
|
+
"content": Array [
|
|
297
|
+
Object {
|
|
298
|
+
"text": "lorem ipsum",
|
|
299
|
+
"type": "text",
|
|
300
|
+
},
|
|
301
|
+
],
|
|
302
|
+
"type": "paragraph",
|
|
303
|
+
},
|
|
304
|
+
],
|
|
305
|
+
"type": "listItem",
|
|
306
|
+
},
|
|
307
|
+
],
|
|
308
|
+
"type": "list",
|
|
309
|
+
},
|
|
310
|
+
],
|
|
311
|
+
"type": "doc",
|
|
312
|
+
}
|
|
313
|
+
`;
|
|
314
|
+
|
|
315
|
+
exports[`parsing html should parse decimal type by class 1`] = `
|
|
316
|
+
Object {
|
|
317
|
+
"content": Array [
|
|
318
|
+
Object {
|
|
319
|
+
"attrs": Object {
|
|
320
|
+
"bullet": Object {
|
|
321
|
+
"type": "decimal",
|
|
322
|
+
},
|
|
323
|
+
},
|
|
324
|
+
"content": Array [
|
|
325
|
+
Object {
|
|
326
|
+
"content": Array [
|
|
327
|
+
Object {
|
|
328
|
+
"attrs": Object {
|
|
329
|
+
"preset": null,
|
|
330
|
+
},
|
|
331
|
+
"content": Array [
|
|
332
|
+
Object {
|
|
333
|
+
"text": "lorem ipsum",
|
|
334
|
+
"type": "text",
|
|
335
|
+
},
|
|
336
|
+
],
|
|
337
|
+
"type": "paragraph",
|
|
338
|
+
},
|
|
339
|
+
],
|
|
340
|
+
"type": "listItem",
|
|
341
|
+
},
|
|
342
|
+
],
|
|
343
|
+
"type": "list",
|
|
344
|
+
},
|
|
345
|
+
],
|
|
346
|
+
"type": "doc",
|
|
347
|
+
}
|
|
348
|
+
`;
|
|
349
|
+
|
|
350
|
+
exports[`parsing html should parse disc as default 1`] = `
|
|
351
|
+
Object {
|
|
352
|
+
"content": Array [
|
|
353
|
+
Object {
|
|
354
|
+
"attrs": Object {
|
|
355
|
+
"bullet": Object {
|
|
356
|
+
"type": "disc",
|
|
357
|
+
},
|
|
358
|
+
},
|
|
359
|
+
"content": Array [
|
|
360
|
+
Object {
|
|
361
|
+
"content": Array [
|
|
362
|
+
Object {
|
|
363
|
+
"attrs": Object {
|
|
364
|
+
"preset": null,
|
|
365
|
+
},
|
|
366
|
+
"content": Array [
|
|
367
|
+
Object {
|
|
368
|
+
"text": "lorem ipsum",
|
|
369
|
+
"type": "text",
|
|
370
|
+
},
|
|
371
|
+
],
|
|
372
|
+
"type": "paragraph",
|
|
373
|
+
},
|
|
374
|
+
],
|
|
375
|
+
"type": "listItem",
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
"type": "list",
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
"type": "doc",
|
|
382
|
+
}
|
|
383
|
+
`;
|
|
384
|
+
|
|
385
|
+
exports[`parsing html should parse disc type by class 1`] = `
|
|
386
|
+
Object {
|
|
387
|
+
"content": Array [
|
|
388
|
+
Object {
|
|
389
|
+
"attrs": Object {
|
|
390
|
+
"bullet": Object {
|
|
391
|
+
"type": "disc",
|
|
392
|
+
},
|
|
393
|
+
},
|
|
394
|
+
"content": Array [
|
|
395
|
+
Object {
|
|
396
|
+
"content": Array [
|
|
397
|
+
Object {
|
|
398
|
+
"attrs": Object {
|
|
399
|
+
"preset": null,
|
|
400
|
+
},
|
|
401
|
+
"content": Array [
|
|
402
|
+
Object {
|
|
403
|
+
"text": "lorem ipsum",
|
|
404
|
+
"type": "text",
|
|
405
|
+
},
|
|
406
|
+
],
|
|
407
|
+
"type": "paragraph",
|
|
408
|
+
},
|
|
409
|
+
],
|
|
410
|
+
"type": "listItem",
|
|
411
|
+
},
|
|
412
|
+
],
|
|
413
|
+
"type": "list",
|
|
414
|
+
},
|
|
415
|
+
],
|
|
416
|
+
"type": "doc",
|
|
417
|
+
}
|
|
418
|
+
`;
|
|
419
|
+
|
|
420
|
+
exports[`parsing html should parse latin type by class 1`] = `
|
|
421
|
+
Object {
|
|
422
|
+
"content": Array [
|
|
423
|
+
Object {
|
|
424
|
+
"attrs": Object {
|
|
425
|
+
"bullet": Object {
|
|
426
|
+
"type": "latin",
|
|
427
|
+
},
|
|
428
|
+
},
|
|
429
|
+
"content": Array [
|
|
430
|
+
Object {
|
|
431
|
+
"content": Array [
|
|
432
|
+
Object {
|
|
433
|
+
"attrs": Object {
|
|
434
|
+
"preset": null,
|
|
435
|
+
},
|
|
436
|
+
"content": Array [
|
|
437
|
+
Object {
|
|
438
|
+
"text": "lorem ipsum",
|
|
439
|
+
"type": "text",
|
|
440
|
+
},
|
|
441
|
+
],
|
|
442
|
+
"type": "paragraph",
|
|
443
|
+
},
|
|
444
|
+
],
|
|
445
|
+
"type": "listItem",
|
|
446
|
+
},
|
|
447
|
+
],
|
|
448
|
+
"type": "list",
|
|
449
|
+
},
|
|
450
|
+
],
|
|
451
|
+
"type": "doc",
|
|
452
|
+
}
|
|
453
|
+
`;
|
|
454
|
+
|
|
455
|
+
exports[`parsing html should parse latin type by lower attribute 1`] = `
|
|
456
|
+
Object {
|
|
457
|
+
"content": Array [
|
|
458
|
+
Object {
|
|
459
|
+
"attrs": Object {
|
|
460
|
+
"bullet": Object {
|
|
461
|
+
"type": "latin",
|
|
462
|
+
},
|
|
463
|
+
},
|
|
464
|
+
"content": Array [
|
|
465
|
+
Object {
|
|
466
|
+
"content": Array [
|
|
467
|
+
Object {
|
|
468
|
+
"attrs": Object {
|
|
469
|
+
"preset": null,
|
|
470
|
+
},
|
|
471
|
+
"content": Array [
|
|
472
|
+
Object {
|
|
473
|
+
"text": "lorem ipsum",
|
|
474
|
+
"type": "text",
|
|
475
|
+
},
|
|
476
|
+
],
|
|
477
|
+
"type": "paragraph",
|
|
478
|
+
},
|
|
479
|
+
],
|
|
480
|
+
"type": "listItem",
|
|
481
|
+
},
|
|
482
|
+
],
|
|
483
|
+
"type": "list",
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
"type": "doc",
|
|
487
|
+
}
|
|
488
|
+
`;
|
|
489
|
+
|
|
490
|
+
exports[`parsing html should parse latin type by upper attribute 1`] = `
|
|
491
|
+
Object {
|
|
492
|
+
"content": Array [
|
|
493
|
+
Object {
|
|
494
|
+
"attrs": Object {
|
|
495
|
+
"bullet": Object {
|
|
496
|
+
"type": "latin",
|
|
497
|
+
},
|
|
498
|
+
},
|
|
499
|
+
"content": Array [
|
|
500
|
+
Object {
|
|
501
|
+
"content": Array [
|
|
502
|
+
Object {
|
|
503
|
+
"attrs": Object {
|
|
504
|
+
"preset": null,
|
|
505
|
+
},
|
|
506
|
+
"content": Array [
|
|
507
|
+
Object {
|
|
508
|
+
"text": "lorem ipsum",
|
|
509
|
+
"type": "text",
|
|
510
|
+
},
|
|
511
|
+
],
|
|
512
|
+
"type": "paragraph",
|
|
513
|
+
},
|
|
514
|
+
],
|
|
515
|
+
"type": "listItem",
|
|
516
|
+
},
|
|
517
|
+
],
|
|
518
|
+
"type": "list",
|
|
519
|
+
},
|
|
520
|
+
],
|
|
521
|
+
"type": "doc",
|
|
522
|
+
}
|
|
523
|
+
`;
|
|
524
|
+
|
|
525
|
+
exports[`parsing html should parse roman type by class 1`] = `
|
|
526
|
+
Object {
|
|
527
|
+
"content": Array [
|
|
528
|
+
Object {
|
|
529
|
+
"attrs": Object {
|
|
530
|
+
"bullet": Object {
|
|
531
|
+
"type": "roman",
|
|
532
|
+
},
|
|
533
|
+
},
|
|
534
|
+
"content": Array [
|
|
535
|
+
Object {
|
|
536
|
+
"content": Array [
|
|
537
|
+
Object {
|
|
538
|
+
"attrs": Object {
|
|
539
|
+
"preset": null,
|
|
540
|
+
},
|
|
541
|
+
"content": Array [
|
|
542
|
+
Object {
|
|
543
|
+
"text": "lorem ipsum",
|
|
544
|
+
"type": "text",
|
|
545
|
+
},
|
|
546
|
+
],
|
|
547
|
+
"type": "paragraph",
|
|
548
|
+
},
|
|
549
|
+
],
|
|
550
|
+
"type": "listItem",
|
|
551
|
+
},
|
|
552
|
+
],
|
|
553
|
+
"type": "list",
|
|
554
|
+
},
|
|
555
|
+
],
|
|
556
|
+
"type": "doc",
|
|
557
|
+
}
|
|
558
|
+
`;
|
|
559
|
+
|
|
560
|
+
exports[`parsing html should parse roman type by lower attribute 1`] = `
|
|
561
|
+
Object {
|
|
562
|
+
"content": Array [
|
|
563
|
+
Object {
|
|
564
|
+
"attrs": Object {
|
|
565
|
+
"bullet": Object {
|
|
566
|
+
"type": "roman",
|
|
567
|
+
},
|
|
568
|
+
},
|
|
569
|
+
"content": Array [
|
|
570
|
+
Object {
|
|
571
|
+
"content": Array [
|
|
572
|
+
Object {
|
|
573
|
+
"attrs": Object {
|
|
574
|
+
"preset": null,
|
|
575
|
+
},
|
|
576
|
+
"content": Array [
|
|
577
|
+
Object {
|
|
578
|
+
"text": "lorem ipsum",
|
|
579
|
+
"type": "text",
|
|
580
|
+
},
|
|
581
|
+
],
|
|
582
|
+
"type": "paragraph",
|
|
583
|
+
},
|
|
584
|
+
],
|
|
585
|
+
"type": "listItem",
|
|
586
|
+
},
|
|
587
|
+
],
|
|
588
|
+
"type": "list",
|
|
589
|
+
},
|
|
590
|
+
],
|
|
591
|
+
"type": "doc",
|
|
592
|
+
}
|
|
593
|
+
`;
|
|
594
|
+
|
|
595
|
+
exports[`parsing html should parse roman type by upper attribute 1`] = `
|
|
596
|
+
Object {
|
|
597
|
+
"content": Array [
|
|
598
|
+
Object {
|
|
599
|
+
"attrs": Object {
|
|
600
|
+
"bullet": Object {
|
|
601
|
+
"type": "roman",
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
"content": Array [
|
|
605
|
+
Object {
|
|
606
|
+
"content": Array [
|
|
607
|
+
Object {
|
|
608
|
+
"attrs": Object {
|
|
609
|
+
"preset": null,
|
|
610
|
+
},
|
|
611
|
+
"content": Array [
|
|
612
|
+
Object {
|
|
613
|
+
"text": "lorem ipsum",
|
|
614
|
+
"type": "text",
|
|
615
|
+
},
|
|
616
|
+
],
|
|
617
|
+
"type": "paragraph",
|
|
618
|
+
},
|
|
619
|
+
],
|
|
620
|
+
"type": "listItem",
|
|
621
|
+
},
|
|
622
|
+
],
|
|
623
|
+
"type": "list",
|
|
624
|
+
},
|
|
625
|
+
],
|
|
626
|
+
"type": "doc",
|
|
627
|
+
}
|
|
628
|
+
`;
|
|
629
|
+
|
|
630
|
+
exports[`parsing html should parse square type by class 1`] = `
|
|
631
|
+
Object {
|
|
632
|
+
"content": Array [
|
|
633
|
+
Object {
|
|
634
|
+
"attrs": Object {
|
|
635
|
+
"bullet": Object {
|
|
636
|
+
"type": "square",
|
|
637
|
+
},
|
|
638
|
+
},
|
|
639
|
+
"content": Array [
|
|
640
|
+
Object {
|
|
641
|
+
"content": Array [
|
|
642
|
+
Object {
|
|
643
|
+
"attrs": Object {
|
|
644
|
+
"preset": null,
|
|
645
|
+
},
|
|
646
|
+
"content": Array [
|
|
647
|
+
Object {
|
|
648
|
+
"text": "lorem ipsum",
|
|
649
|
+
"type": "text",
|
|
650
|
+
},
|
|
651
|
+
],
|
|
652
|
+
"type": "paragraph",
|
|
653
|
+
},
|
|
654
|
+
],
|
|
655
|
+
"type": "listItem",
|
|
656
|
+
},
|
|
657
|
+
],
|
|
658
|
+
"type": "list",
|
|
659
|
+
},
|
|
660
|
+
],
|
|
661
|
+
"type": "doc",
|
|
662
|
+
}
|
|
663
|
+
`;
|