mirror of
https://github.com/ianstormtaylor/slate.git
synced 2025-04-15 10:52:34 +02:00
Fix failing unhangRange test case with inlines (#4814)
* Add failing unhangRange test case * Fix failing inline case? * fix lint
This commit is contained in:
parent
6ef6454e44
commit
01dc0c57b2
@ -1656,7 +1656,7 @@ export const Editor: EditorInterface = {
|
||||
match: n => Editor.isBlock(editor, n),
|
||||
})
|
||||
const blockPath = endBlock ? endBlock[1] : []
|
||||
const first = Editor.start(editor, [])
|
||||
const first = Editor.start(editor, start)
|
||||
const before = { anchor: first, focus: end }
|
||||
let skip = true
|
||||
|
||||
|
@ -0,0 +1,34 @@
|
||||
/** @jsx jsx */
|
||||
import { Editor } from 'slate'
|
||||
import { jsx } from '../../..'
|
||||
|
||||
export const input = (
|
||||
<editor>
|
||||
<block>
|
||||
<text>Block before</text>
|
||||
</block>
|
||||
<block>
|
||||
<text>
|
||||
<anchor />
|
||||
Some text before{' '}
|
||||
</text>
|
||||
<inline void>
|
||||
<focus />
|
||||
</inline>
|
||||
<text />
|
||||
</block>
|
||||
<block>
|
||||
<text>Another block</text>
|
||||
</block>
|
||||
</editor>
|
||||
)
|
||||
|
||||
export const test = editor => {
|
||||
const range = Editor.unhangRange(editor, editor.selection)
|
||||
return range
|
||||
}
|
||||
|
||||
export const output = {
|
||||
anchor: { path: [1, 0], offset: 0 },
|
||||
focus: { path: [1, 1, 0], offset: 0 },
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user