Convert plain HTML to DraftJS content blocks and entity maps for use with React rich text editors.
HTML To DraftJS is a JavaScript library that converts plain HTML strings into DraftJS content blocks and entity maps. It solves the problem of importing existing HTML content into DraftJS-based rich text editors, enabling seamless content migration and editor state initialization.
Frontend developers using DraftJS and react-draft-wysiwyg for building rich text editors in React applications.
Developers choose it for its focused functionality, easy integration with react-draft-wysiwyg, and ability to handle custom HTML elements via a flexible chunk renderer, simplifying HTML-to-editor content conversion.
HTML To DraftJS is a JavaScript library that transforms plain HTML into DraftJS-compatible content blocks and entity maps. It enables developers to seamlessly import existing HTML content into DraftJS-based rich text editors, bridging the gap between static HTML and interactive editor states.
<hr>) to map them to DraftJS atomic blocks.It focuses on providing a reliable, lightweight bridge between static HTML content and the DraftJS editor ecosystem, prioritizing ease of integration and extensibility for custom HTML elements.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a straightforward API that directly outputs DraftJS content blocks and entity maps, making it easy to initialize EditorState with existing HTML, as shown in the README usage example.
Offers a custom chunk renderer to map specific HTML nodes like <hr> to DraftJS atomic blocks, allowing for tailored conversions without extensive boilerplate.
Specifically built for use with react-draft-wysiwyg, ensuring compatibility and reducing integration friction for users of that popular editor.
Described as a lightweight bridge in the philosophy, it adds minimal overhead and is optimized solely for HTML to DraftJS conversion.
The library is useless if you're not using DraftJS, as it outputs data structures specific to that framework, creating vendor lock-in and limiting adaptability.
The custom chunk renderer only supports atomic blocks, as noted in the README, which restricts handling of complex, nested HTML elements that might require composite blocks.
The README explicitly warns against using version 1.2.0 due to build issues, indicating potential maintenance problems and reliability concerns for users.