Metadata-Version: 2.2 Name: draftjs_exporter Version: 5.1.0 Summary: Library to convert rich text from Draft.js raw ContentState to HTML Home-page: https://github.com/springload/draftjs_exporter Author: Springload Author-email: hello@springload.co.nz License: MIT Project-URL: Source, https://github.com/springload/draftjs_exporter Project-URL: Tracker, https://github.com/springload/draftjs_exporter/issues Project-URL: Changelog, https://github.com/springload/draftjs_exporter/blob/main/CHANGELOG.md Classifier: Environment :: Web Environment Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Development Status :: 5 - Production/Stable Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3.14 Classifier: Topic :: Internet :: WWW/HTTP Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content Classifier: Topic :: Internet :: WWW/HTTP :: Site Management Classifier: Topic :: Software Development :: Libraries :: Application Frameworks Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Topic :: Text Editors :: Word Processors Classifier: Typing :: Typed Description-Content-Type: text/markdown License-File: LICENSE Provides-Extra: lxml Requires-Dist: lxml<6,>=4.2.0; extra == "lxml" Provides-Extra: html5lib Requires-Dist: beautifulsoup4<5,>=4.4.1; extra == "html5lib" Requires-Dist: html5lib<2,>=0.999; extra == "html5lib" Dynamic: author Dynamic: author-email Dynamic: classifier Dynamic: description Dynamic: description-content-type Dynamic: home-page Dynamic: license Dynamic: project-url Dynamic: provides-extra Dynamic: summary # [Draft.js exporter](https://pypi.org/project/draftjs_exporter/) > Library to convert rich text from Draft.js raw ContentState to HTML. It is developed alongside the [Draftail](https://www.draftail.org/) rich text editor, for [Wagtail](https://github.com/wagtail/wagtail). Check out the [online demo](http://playground.draftail.org/), and our [introductory blog post](https://www.draftail.org/blog/2018/03/13/rethinking-rich-text-pipelines-with-draft-js). ## Why [Draft.js](https://draftjs.org/) is a rich text editor framework for [React](https://reactjs.org/). Its approach is different from most rich text editors because it does not store data as HTML, but rather in its own representation called ContentState. This exporter is useful when the ContentState to HTML conversion has to be done in a Python ecosystem. The initial use case was to gain more control over the content managed by rich text editors in a Wagtail/Django site. If you want to read the full story, have a look at our blog post: [Rethinking rich text pipelines with Draft.js](https://www.draftail.org/blog/2018/03/13/rethinking-rich-text-pipelines-with-draft-js). ## Features This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html), and [measures performance](https://thib.me/python-memory-profiling-for-the-draft-js-exporter) and [code coverage](https://coveralls.io/github/springload/draftjs_exporter). Code is checked with [mypy](https://mypy.readthedocs.io/en/latest/index.html). - Extensive configuration of the generated HTML. - Default, extensible block & inline style maps for common HTML elements. - Convert line breaks to `
` elements. - Define any attribute in the block map – custom class names for elements. - React-like API to create custom components. - Automatic conversion of entity data to HTML attributes (int & boolean to string, style object to style string). - Nested lists (`
  • ` elements go inside `