mirror of
https://github.com/larvit/adf-codec.git
synced 2026-11-18 22:25:44 +01:00
Hold the editor's join rule in plain/editor-normal.ts as the reader's over editor-normal forms
This commit is contained in:
@@ -75,3 +75,8 @@ test('normalizes blocks and mark attributes nesting far past the levels a recurs
|
||||
const merged = toEditorNormal({ content: [{ content: [{ marks, text: 'a', type: 'text' }, { marks, text: 'b', type: 'text' }], type: 'paragraph' }], type: 'doc', version: 1 })
|
||||
assert.deepEqual(merged.content?.[0]?.content?.map((text) => text.text), ['ab'])
|
||||
})
|
||||
|
||||
test('joins a text node holding content to its neighbour, as editor-normal forms hold no content to part them', () => {
|
||||
const paragraph: AdfNode = { content: [{ content: [{ text: 'lost', type: 'text' }], text: 'a', type: 'text' }, { text: 'b', type: 'text' }], type: 'paragraph' }
|
||||
assert.deepEqual(toEditorNormal({ content: [paragraph], type: 'doc', version: 1 }).content, [{ content: [{ content: [{ text: 'lost', type: 'text' }], text: 'ab', type: 'text' }], type: 'paragraph' }])
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user