diff options
| -rw-r--r-- | NEWS | 4 | ||||
| -rw-r--r-- | README.md | 19 |
2 files changed, 23 insertions, 0 deletions
@@ -1,3 +1,7 @@ +# 1.1.0 + +* Add support for comments. + # 1.0.4 * Add support for w:sdt elements. This allows the bodies of content controls, @@ -39,6 +39,8 @@ The following features are currently supported: * Text boxes. The contents of the text box are treated as a separate paragraph that appears after the paragraph containing the text box. +* Comments. + ## Installation pip install mammoth @@ -239,6 +241,23 @@ with open("document.docx", "rb") as docx_file: result = mammoth.convert_to_html(docx_file, style_map=style_map) ``` +#### Comments + +By default, comments are ignored. +To include comments in the generated HTML, +add a style mapping for `comment-reference`. +For instance: + +```python +style_map = "comment-reference => sup" + +with open("document.docx", "rb") as docx_file: + result = mammoth.convert_to_html(docx_file, style_map=style_map) +``` + +Comments will be appended to the end of the document, +with links to the comments wrapped using the specified style mapping. + ### API #### `mammoth.convert_to_html(fileobj, **kwargs)` |
