privateOmega/html-to-docx

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

Closed this issue · 3 comments

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>

#197 linking your PR

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

closing the issue as the pr is merged