Skip to content

Commit 26a34da

Browse files
committed
...
1 parent a422166 commit 26a34da

File tree

1 file changed

+39
-40
lines changed

1 file changed

+39
-40
lines changed

.github/workflows/buildbug.yml

Lines changed: 39 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -34,44 +34,44 @@ jobs:
3434
}
3535
EOF
3636
37-
#- run: |
38-
# cat <<EOF > lexical-cli-render-tsx.ts
39-
# import { EmojiNode } from "./EmojiNode";
40-
# import { TextNode, $getRoot, $selectAll } from "lexical";
41-
# import { createHeadlessEditor } from "@lexical/headless";
42-
# import { $generateHtmlFromNodes } from "@lexical/html";
43-
# import { JSDOM } from 'jsdom';
44-
# import { HeadingNode, QuoteNode } from "@lexical/rich-text";
45-
# import { LinkNode } from "@lexical/link";
46-
# import { HashtagNode } from "@lexical/hashtag";
47-
# import { ListNode, ListItemNode } from "@lexical/list";
48-
# let input : string = "", html : string = "";
49-
# const editor = createHeadlessEditor({
50-
# editable: false,
51-
# nodes: [TextNode, HeadingNode, QuoteNode, LinkNode, HashtagNode, ListNode, ListItemNode, EmojiNode],
52-
# onError: (error) => { throw error;},
53-
# });
54-
# const dom = new JSDOM();
55-
# global.window = dom.window;
56-
# global.document = dom.window.document;
57-
# process.stdin.on("data", (chunk) => { input += chunk; });
58-
# process.stdin.on("end", async () =>
59-
# {
60-
# try
61-
# {
62-
# const editorStateJson = JSON.parse(input).editorState;
63-
# const editorState = editor.parseEditorState(editorStateJson);
64-
# editor.setEditorState(editorState);
65-
# editor.update(() => { html = $generateHtmlFromNodes(editor, $selectAll()); });
66-
# console.log(html);
67-
# }
68-
# catch (error)
69-
# {
70-
# console.error("Error processing EditorState JSON:", error);
71-
# process.exit(1);
72-
# }
73-
# });
74-
# EOF
37+
- run: |
38+
cat > lexical-cli-render-tsx.ts << 'EOF'
39+
import { EmojiNode } from "./EmojiNode";
40+
import { TextNode, $getRoot, $selectAll } from "lexical";
41+
import { createHeadlessEditor } from "@lexical/headless";
42+
import { $generateHtmlFromNodes } from "@lexical/html";
43+
import { JSDOM } from 'jsdom';
44+
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
45+
import { LinkNode } from "@lexical/link";
46+
import { HashtagNode } from "@lexical/hashtag";
47+
import { ListNode, ListItemNode } from "@lexical/list";
48+
let input : string = "", html : string = "";
49+
const editor = createHeadlessEditor({
50+
editable: false,
51+
nodes: [TextNode, HeadingNode, QuoteNode, LinkNode, HashtagNode, ListNode, ListItemNode, EmojiNode],
52+
onError: (error) => { throw error;},
53+
});
54+
const dom = new JSDOM();
55+
global.window = dom.window;
56+
global.document = dom.window.document;
57+
process.stdin.on("data", (chunk) => { input += chunk; });
58+
process.stdin.on("end", async () =>
59+
{
60+
try
61+
{
62+
const editorStateJson = JSON.parse(input).editorState;
63+
const editorState = editor.parseEditorState(editorStateJson);
64+
editor.setEditorState(editorState);
65+
editor.update(() => { html = $generateHtmlFromNodes(editor, $selectAll()); });
66+
console.log(html);
67+
}
68+
catch (error)
69+
{
70+
console.error("Error processing EditorState JSON:", error);
71+
process.exit(1);
72+
}
73+
});
74+
EOF
7575
7676
- run: |
7777
cat > EmojiNode.tsx << 'EOF'
@@ -165,5 +165,4 @@ jobs:
165165

166166
- run: |
167167
sed -i 's@"type": "module",@@' package.json
168-
cat EmojiNode.tsx
169-
#cat samples/playground.lexical.json | npx ts-node lexical-cli-render-tsx.ts
168+
cat samples/playground.lexical.json | npx ts-node lexical-cli-render-tsx.ts

0 commit comments

Comments
 (0)