docs(richtext-lexical): clarify that HTML generation has to happen on the server

This commit is contained in:
Alessio Gravili
2024-04-03 09:52:31 -04:00
parent fe280e6bb1
commit 1cfdf3613c

View File

@@ -173,7 +173,7 @@ Next, take a look at the [features we've already built](https://github.com/paylo
Lexical saves data in JSON, but can also generate its HTML representation via two main methods:
1. **Outputting HTML from the Collection:** Create a new field in your collection to convert saved JSON content to HTML. Payload generates and outputs the HTML for use in your frontend.
2. **Generating HTML on the Frontend:** Convert JSON to HTML on-demand, either in your frontend or elsewhere.
2. **Generating HTML on any server** Convert JSON to HTML on-demand on the server.
The editor comes with built-in HTML serializers, simplifying the process of converting JSON to HTML.
@@ -207,7 +207,7 @@ const Pages: CollectionConfig = {
The `lexicalHTML()` function creates a new field that automatically converts the referenced lexical richText field into HTML through an afterRead hook.
#### Generating HTML in the Frontend:
#### Generating HTML anywhere on the server:
If you wish to convert JSON to HTML ad-hoc, use this code snippet: