mwilliamson / python-mammoth

Convert Word documents (.docx files) to HTML
BSD 2-Clause "Simplified" License
811 stars 121 forks source link

Support for Image with link #77

Open BaoBao0406 opened 5 years ago

BaoBao0406 commented 5 years ago

Hi, I use mammoth to convert a Word document with a image, and the Image has a hyperlink. After I convert to HTML file, the link did not appear in the Image. Please see the below for my code.

import mammoth

with open('EmailTemplate1.docx', 'rb') as docx_file: result = mammoth.convert_to_html(docx_file) html = result.value

with open('Template1.html', 'w') as file1: file1.write(html)

Could mammoth convert the hyperlink for a image? Please let me know if i miss something. Thank you so much!

mwilliamson commented 5 years ago

Could you provide a minimal example document?

BaoBao0406 commented 5 years ago

Please see the attachment below. Inside the Word file, there is a image with a link. Let me know if you need more information.

EmailTemplate.docx