You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -48,14 +48,14 @@ from draftjs_exporter.html import HTML
48
48
# Configuration options are detailed below.
49
49
config = {}
50
50
51
-
#Initialise the exporter.
51
+
#Initialize the exporter.
52
52
exporter = HTML(config)
53
53
54
54
# Render a Draft.js `contentState`
55
55
html = exporter.render({
56
56
'entityMap': {},
57
57
'blocks': [{
58
-
'key': '6mgfh',
58
+
'key': '6m5fh',
59
59
'text': 'Hello, world!',
60
60
'type': 'unstyled',
61
61
'depth': 0,
@@ -191,7 +191,7 @@ def button(props):
191
191
)
192
192
```
193
193
194
-
Apart from `create_element`, a `parse_html` method is also available. Use it to interface with other HTML generators, like template engines.
194
+
Apart from `create_element`, a `parse_html` method is also available. Use it to interface with other HTML generators, like template engines – at your own risk: that method does not sanitize the input.
195
195
196
196
See `examples.py` in the repository for more details.
197
197
@@ -243,7 +243,7 @@ By default, the exporter uses a dependency-free engine called `string` to build
243
243
-`lxml`.
244
244
-`string_compat` (A variant of `string` with no backwards-incompatible changes since its first release).
245
245
246
-
The `string` engine is the fastest, and does not have any dependencies. Its only drawback is that the `parse_html` method does not escape/sanitise HTML like that of other engines.
246
+
The `string` engine is the fastest, and does not have any dependencies. Its only drawback is that the `parse_html` method does not escape/sanitize HTML like that of other engines.
247
247
248
248
- For `html5lib`, do `pip install draftjs_exporter[html5lib]`.
249
249
- For `lxml`, do `pip install draftjs_exporter[lxml]`. It also requires `libxml2` and `libxslt` to be available on your system.
@@ -293,7 +293,7 @@ class DOMListTree(DOMEngine):
293
293
294
294
exporter = HTML({
295
295
# Use the dotted module syntax to point to the DOMEngine implementation.
0 commit comments