Creating a custom plugin with WYSIWYG behavior. #816
Unanswered
jonathangaldino
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone ✋
Goal
I've been trying to build custom plugins with WYSIWYG behavior. My goal is to write a plugin that I can embed the youtube iframe into the editor.
That means, when I paste or write a the following text:
https://www.youtube.com/watch?v=gA6r7iVzP6M
, it will transform it to a react component in the editor, but in the background, this is simply a text.My attempt
I cloned the
editor
rep and tried to build my own plugin and render it inladdle
. it wasn't changing the text node to a youtube custom node.Question
What am I missing? Do I need to write a command to insert the youtube node?
Achieve the wanted behavior using lexical directly - without mdx-editor
With Lexical (+react) I was able to achieve the following behavior:
Screen.Recording.2025-07-16.at.15.23.45.mov
After pasting a Youtube link, it renders to a react component. This is exactly the same behavior I am trying to build, buth with mdx-editor.
This is my YoutubePlugin component, that I add to the LexicalComposer:
And here is the YoutubeNode:
Beta Was this translation helpful? Give feedback.
All reactions