Skip to content

Commit 0679e0f

Browse files
committed
style: 💄 run formatter
1 parent 3b43b90 commit 0679e0f

File tree

5 files changed

+34
-32
lines changed

5 files changed

+34
-32
lines changed

src/json-crdt-extensions/peritext/registry/SliceRegistry.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ export class SliceRegistry {
3030
}
3131
const tag = CommonSliceType[type as any];
3232
if (tag && typeof tag === 'string') {
33-
fromHtmlMap.set(tag, [
34-
[def, () => [type, null]]
35-
])
33+
fromHtmlMap.set(tag, [[def, () => [type, null]]]);
3634
}
3735
}
3836

src/json-crdt-extensions/peritext/transfer/__tests__/PeritextDataTransfer.spec.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,8 @@ describe('Markdown', () => {
252252

253253
test('can insert realistic 3 paragraphs of Markdown', () => {
254254
const {peritext, transfer} = setup();
255-
const md = 'The German __automotive sector__ is in the process of _cutting ' +
255+
const md =
256+
'The German __automotive sector__ is in the process of _cutting ' +
256257
'thousands of jobs_ as it grapples with a global shift toward electric vehicles ' +
257258
'— a transformation Musk himself has been at the forefront of.' +
258259
'\n\n' +

src/json-crdt-extensions/peritext/transfer/__tests__/import-html.spec.ts

+16-16
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,15 @@ describe('.fromHtml()', () => {
4343
test('can import a single <blockquote> block with nested single <p>', () => {
4444
const html = '<blockquote><p>2b||!2b</p></blockquote>';
4545
const peritextMl = fromHtml(html);
46-
expect(peritextMl).toEqual(['', null,
47-
[CommonSliceType.blockquote, null,
48-
[CommonSliceType.p, null, '2b||!2b']
49-
],
50-
]);
46+
expect(peritextMl).toEqual(['', null, [CommonSliceType.blockquote, null, [CommonSliceType.p, null, '2b||!2b']]]);
5147
});
5248

5349
test('can import a single <blockquote> block after a <p> block', () => {
5450
const html = '<p>123</p><blockquote>2b||!2b</blockquote>';
5551
const peritextMl = fromHtml(html);
56-
expect(peritextMl).toEqual(['', null,
52+
expect(peritextMl).toEqual([
53+
'',
54+
null,
5755
[CommonSliceType.p, null, '123'],
5856
[CommonSliceType.blockquote, null, '2b||!2b'],
5957
]);
@@ -62,26 +60,28 @@ describe('.fromHtml()', () => {
6260
test('can import a single <blockquote> block with nested single <p>, after a <p> block', () => {
6361
const html = '<p>123</p><blockquote><p>2b||!2b</p></blockquote>';
6462
const peritextMl = fromHtml(html);
65-
expect(peritextMl).toEqual(['', null,
63+
expect(peritextMl).toEqual([
64+
'',
65+
null,
6666
[CommonSliceType.p, null, '123'],
67-
[CommonSliceType.blockquote, null,
68-
[CommonSliceType.p, null, '2b||!2b']
69-
],
67+
[CommonSliceType.blockquote, null, [CommonSliceType.p, null, '2b||!2b']],
7068
]);
7169
});
7270

7371
test('can import a single <blockquote> block with nested single <p>, after a <p> block with inline formatting', () => {
7472
const html = '<p><b>1</b><code>2</code>3</p><blockquote><p>2b||!2b</p></blockquote>';
7573
const peritextMl = fromHtml(html);
76-
expect(peritextMl).toEqual(['', null,
77-
[CommonSliceType.p, null,
74+
expect(peritextMl).toEqual([
75+
'',
76+
null,
77+
[
78+
CommonSliceType.p,
79+
null,
7880
[CommonSliceType.b, {behavior: SliceBehavior.One, inline: true}, '1'],
7981
[CommonSliceType.code, {behavior: SliceBehavior.One, inline: true}, '2'],
80-
'3'
81-
],
82-
[CommonSliceType.blockquote, null,
83-
[CommonSliceType.p, null, '2b||!2b']
82+
'3',
8483
],
84+
[CommonSliceType.blockquote, null, [CommonSliceType.p, null, '2b||!2b']],
8585
]);
8686
});
8787
});

src/json-crdt-extensions/peritext/transfer/__tests__/import-markdown.spec.ts

+14-11
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ describe('fromMarkdown()', () => {
1010
});
1111

1212
test('multi-block realistic example', () => {
13-
const text = 'The German __automotive sector__ is in the process of *cutting \n' +
13+
const text =
14+
'The German __automotive sector__ is in the process of *cutting \n' +
1415
'thousands of jobs* as it grapples with a global shift toward electric vehicles \n' +
1516
'— a transformation Musk himself has been at the forefront of.\n' +
1617
'\n' +
@@ -20,20 +21,22 @@ describe('fromMarkdown()', () => {
2021
'a `clipboardData` property of type `DataTransfer`. The `DataTransfer` object \n' +
2122
'is used by the Clipboard Events API to hold multiple representations of data.\n';
2223
const peritextMl = fromMarkdown(text);
23-
expect(peritextMl).toEqual(['', null,
24-
[CommonSliceType.p, null,
24+
expect(peritextMl).toEqual([
25+
'',
26+
null,
27+
[
28+
CommonSliceType.p,
29+
null,
2530
'The German ',
2631
[CommonSliceType.b, {behavior: SliceBehavior.One, inline: true}, 'automotive sector'],
2732
' is in the process of ',
2833
[CommonSliceType.i, {behavior: SliceBehavior.One, inline: true}, 'cutting thousands of jobs'],
29-
' as it grapples with a global shift toward electric vehicles — a transformation Musk himself has been at the forefront of.'
34+
' as it grapples with a global shift toward electric vehicles — a transformation Musk himself has been at the forefront of.',
3035
],
31-
[CommonSliceType.blockquote, null,
32-
[CommonSliceType.p, null,
33-
'To be or not to be, that is the question.',
34-
]
35-
],
36-
[CommonSliceType.p, null,
36+
[CommonSliceType.blockquote, null, [CommonSliceType.p, null, 'To be or not to be, that is the question.']],
37+
[
38+
CommonSliceType.p,
39+
null,
3740
'A ',
3841
[CommonSliceType.code, {behavior: SliceBehavior.One, inline: true}, 'ClipboardEvent'],
3942
' is dispatched for copy, cut, and paste events, and it contains a ',
@@ -43,7 +46,7 @@ describe('fromMarkdown()', () => {
4346
'. The ',
4447
[CommonSliceType.code, {behavior: SliceBehavior.One, inline: true}, 'DataTransfer'],
4548
' object is used by the Clipboard Events API to hold multiple representations of data.',
46-
]
49+
],
4750
]);
4851
});
4952
});

src/json-crdt-extensions/peritext/transfer/import-html.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import type {ClipboardData} from './export-html';
1616

1717
/**
1818
* @todo Implement HTML normalization function, ensure that:
19-
*
19+
*
2020
* - <blockquote> and <p> nodes are treated correctly, especially when sole node
2121
* is nested.
2222
* - list nodes are treated correctly.

0 commit comments

Comments
 (0)