-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add HTML export/import documentation to website #2249
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
### Lexical -> HTML | ||
When generating HTML from an editor you can pass in a selection object to narrow it down to a certain section or pass in null to convert the whole editor. | ||
```js | ||
const htmlString = $generateHtmlFromNodes(editor, selection | null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should it be all capital for HTML (to match importDOM, exportDOM, etc)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard to know...is there an official rule for naming camelcase variables with acronyms?
On one hand it reads fine when the function ends with all capitals, but if it's in the middle it becomes a bit harder to read. Happy to rename here and in the code itself if we want to be consistent with DOM and HTML.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's address this in a follow up if needed.
d1a1436
to
67f01d6
Compare
Hey! I was trying to use the library |
Documentation for the
Lexical
->HTML
andHTML
->Lexical
introduced in #2246.