forked from ianstormtaylor/slate
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix failing unhangRange test case with inlines (ianstormtaylor#4814)
* Add failing unhangRange test case * Fix failing inline case? * fix lint
- Loading branch information
Showing
2 changed files
with
35 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
test/interfaces/Editor/unhangRange/inline-range-normal.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 }, | ||
} |