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
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