toRichTextValue function converts an HTML string into a rich text value array.ts
import { toRichTextValue } from "@arkyn/shared";
html (required)stringRichTextValue array generated by parsing the HTML and deserializing each node.RichTextValuetypescript
import { toRichTextValue } from "@arkyn/shared";const html = "<p><strong>Hello world</strong></p>";const richText = toRichTextValue(html);console.log(richText);// Output: [{ type: 'paragraph', children: [{ text: 'Hello world', bold: true }] }]
typescript
import { toRichTextValue } from "@arkyn/shared";const plainText = "Simple text";const richText = toRichTextValue(plainText);console.log(richText);// Output: [{ text: 'Simple text' }]