Extending mdx-editor / lexical editor #506
-
I am wondering what the general philosophy here is. Is it possible to apply lexical knowledge to extend mdx-editor, or can this only be done via the Gurx state manangement thing? https://mdxeditor.dev/editor/docs/extending-the-editor What would need to be done to use a lexical plugin? Is it possible or would one need to reimplement it with an "mdx editor plugin"? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Lexical knowledge is a must if you want to build custom editors, for example. For other things (like support of new syntax), you need understanding of the mdast specifics. Pure lexical plugins can be integrated. For example, I'm using the Hope this makes sense. |
Beta Was this translation helpful? Give feedback.
Lexical knowledge is a must if you want to build custom editors, for example. For other things (like support of new syntax), you need understanding of the mdast specifics.
Pure lexical plugins can be integrated. For example, I'm using the
MarkdownShortcutsPlugin
like this. However, a Lexical plugin "plugin" system is usually just a component that does a bunch of stuff with the editor inuseEffect
. It's hard to make composition / reusability of state like this, as it will usually lead to a mess of spaghetti hooks and context. That's why I came up with the Gurx patterns.Hope this makes sense.