-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting the value #51
Comments
Ahh, that seems to work. Thanks! I assume there isn't some integrated way of converting editor state to HTML at this point in time? I need to store the editor state (as JSON) in a database and then turn that into HTML when rendering the page. Currently trying the regular lexical package for that. |
Hi @PaddiM8 , If you want to load the state in the editor from database, you can simply call Here is sample code for loading editor state from text (where
Is this what you were looking for? |
I want to display the rich text content on a static page actually. It seems like I only need to import lexical/html though so that's fine I guess. Thanks for helping! |
Hey @PaddiM8 Could you tell me what are you doing to show HTML on a webpage without showing the editor? I'm currently using this 0afbc90, which seems to work fine, but my problem is that the HTML is not the same than the one shown in the editor. What I'm seeing is that when showing the editor, both @umaranis Have you thought a better way to do this? |
Hi @ktecho , I have not explored displaying HTML without the editor. I can see that you have tried using the headless lexical package to achieve this. If it works for you, I will appreciate if you could submit a PR. Thanks. |
I think I'm doing something similar and import the CSS in some way to get the same styling |
In my opinion, we should make something to fix the CSS mess. This are the problems I'm seeing: 1- Conflicts with other libraries (#71). I fixed this partially by nesting all the lexical.css classes inside another class:
In this way, I put the Lexical editor inside a But I still have the reverse problem: external libraries changing svelte-lexical behaviour by defining classes like modal, dropdown, etc. 2- Output of Lexical converted to HTML cannot be displayed in the same way as it's in the editor, because in So, to fix both problems, I think we should do this: 1- In 2- In @umaranis what do you think? |
I might have missed something obvious, but I can't quite figure out how to get the value of the editor (eg. during a form submission). The lexical react examples uses the OnChange plugin, which doesn't exist here. Perhaps there should be some example showing this somewhere, if there is a good way to do it yet?
The text was updated successfully, but these errors were encountered: