privateOmega / html-to-docx

HTML to DOCX converter
MIT License
375 stars 141 forks source link

Word file breaking while applying max-width and max-height style to an image tag #196

Closed warlock7 closed 11 months ago

warlock7 commented 1 year ago

Not able to open word file using microsoft word if max-width and max-height style is applied to image tag. But it can be opened in both LibreOffice and WPS.

Sample html:

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <title>Document</title>
    </head>
    <body>
        <div>
            <p>Taken from wikipedia</p>
            <img
                src="https://upload.wikimedia.org/wikipedia/commons/4/47/PNG_transparency_demonstration_1.png"
                alt="Red dot"
                style="max-width:550px;"
            />
        </div>
    </body>
</html>
privateOmega commented 1 year ago

https://github.com/privateOmega/html-to-docx/pull/197 linking your PR

privateOmega commented 1 year ago

@warlock7 Word file still broken for me, could you please check?

warlock7 commented 11 months ago

closing the issue as the pr is merged