Skip to content

Commit e5aea50

Browse files
committed
..
1 parent 9863b9b commit e5aea50

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lexical-cli-render-without-emoji.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ process.stdin.on("end", async () =>
2626
{
2727
try
2828
{
29-
const editorStateJson = JSON.parse(input).editorState;
29+
const editorStateJson = JSON.parse(input);
30+
if('editorState' in editorStateJson) editorStateJson = editorStateJson.editorState;
3031
const editorState = editor.parseEditorState(editorStateJson);
3132
editor.setEditorState(editorState);
3233
editor.update(() => { html = $generateHtmlFromNodes(editor, $selectAll()); });

lexical-cli-render.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ process.stdin.on("end", async () =>
2626
{
2727
try
2828
{
29-
const editorStateJson = JSON.parse(input).editorState;
29+
let editorStateJson = JSON.parse(input);
30+
if('editorState' in editorStateJson) editorStateJson = editorStateJson.editorState;
3031
const editorState = editor.parseEditorState(editorStateJson);
3132
editor.setEditorState(editorState);
3233
editor.update(() => { html = $generateHtmlFromNodes(editor, $selectAll()); });

0 commit comments

Comments
 (0)