-
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Brent Farese
committed
Jul 21, 2023
1 parent
69f3e0e
commit 22ed98e
Showing
3 changed files
with
38 additions
and
2 deletions.
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
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
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,27 @@ | ||
/** @jsx jsx */ | ||
import { Editor } from 'slate'; | ||
import { jsx } from '../../../../support/jsx'; | ||
import { YjsEditor, yTextToSlateElement } from '../../src'; | ||
|
||
export const input = ( | ||
<editor> | ||
<unstyled> | ||
<text bold /> | ||
</unstyled> | ||
</editor> | ||
); | ||
|
||
export const expected = { | ||
children: [ | ||
<unstyled> | ||
<text bold /> | ||
</unstyled>, | ||
], | ||
}; | ||
|
||
export function run(editor: Editor) { | ||
const isYJSEditor = YjsEditor.isYjsEditor(editor); | ||
if (!isYJSEditor) return; | ||
|
||
return yTextToSlateElement(editor.sharedRoot); | ||
} |