Skip to content

Support for JSON format in content import/export and HTML <-> JSON conversion #649

@amigo70707

Description

@amigo70707

Hi there! Thanks for the great work on this library.

Currently, react-native-enriched-html only supports HTML string format for content import and export. While there is nothing inherently wrong with this, it can create challenges when storing data in server-side databases, as storing raw HTML strings is generally not considered a best practice. Other web-based editors handle this by providing JSON format support, allowing users to seamlessly import and export their content as JSON.

The main benefits of adding JSON support include:

Easier and safer database storage: It aligns much better with backend best practices.
Simplified backend validation: JSON is much easier to iterate over and validate to ensure the correctness of the state.
It would be amazing if you could consider adding JSON import/export capabilities, along with some utility functions to easily convert HTML to JSON and JSON to HTML.

For reference, here is an example of how this is solved in another web editor:

https://tiptap.dev/docs/guides/output-json-html
https://tiptap.dev/docs/editor/api/utilities/html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions