-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Include void node in range - Add delete-void-at-end test - Add delete-void-and-newline-at-end test
- Loading branch information
1 parent
912d4b7
commit 855e25f
Showing
5 changed files
with
82 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
40 changes: 40 additions & 0 deletions
40
packages/slate/test/transforms/delete/voids-true/delete-void-and-newline-at-end.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,40 @@ | ||
/** @jsx jsx */ | ||
import { Editor, Transforms } from 'slate' | ||
import { jsx } from '../../..' | ||
|
||
export const input = ( | ||
<editor> | ||
<block> | ||
<text> | ||
<anchor /> | ||
This is a first paragraph | ||
</text> | ||
</block> | ||
<block> | ||
<text>This is the second paragraph</text> | ||
</block> | ||
<block void> | ||
<text /> | ||
</block> | ||
<block> | ||
<text> | ||
<focus /> | ||
</text> | ||
</block> | ||
</editor> | ||
) | ||
export const run = editor => { | ||
editor.deleteFragment(editor) | ||
} | ||
export const output = ( | ||
<editor> | ||
<block> | ||
<text> | ||
<cursor /> | ||
</text> | ||
</block> | ||
<block> | ||
<text /> | ||
</block> | ||
</editor> | ||
) |
34 changes: 34 additions & 0 deletions
34
packages/slate/test/transforms/delete/voids-true/delete-void-at-end.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, Transforms } from 'slate' | ||
import { jsx } from '../../..' | ||
|
||
export const input = ( | ||
<editor> | ||
<block> | ||
<text> | ||
<anchor /> | ||
This is a first paragraph | ||
</text> | ||
</block> | ||
<block> | ||
<text>This is the second paragraph</text> | ||
</block> | ||
<block void> | ||
<text> | ||
<focus /> | ||
</text> | ||
</block> | ||
</editor> | ||
) | ||
export const run = editor => { | ||
editor.deleteFragment(editor) | ||
} | ||
export const output = ( | ||
<editor> | ||
<block> | ||
<text> | ||
<cursor /> | ||
</text> | ||
</block> | ||
</editor> | ||
) |
Binary file not shown.