pass 'style_map' kwarg to mammoth when converting docx

This commit is contained in:
Ville Puuska
2024-12-15 16:59:21 +02:00
parent 81e3f24acd
commit 0704b0b6ff
3 changed files with 23 additions and 1 deletions

View File

@@ -492,7 +492,9 @@ class DocxConverter(HtmlConverter):
result = None
with open(local_path, "rb") as docx_file:
result = mammoth.convert_to_html(docx_file)
style_map = kwargs.get("style_map", None)
result = mammoth.convert_to_html(docx_file, style_map=style_map)
html_content = result.value
result = self._convert(html_content)