humenda / GladTeX

embed LaTeX formulas into LaTeX
https://humenda.github.io/GladTeX
GNU Lesser General Public License v3.0
27 stars 7 forks source link

width and height should be without "px" or within the style attribute. #8

Closed SushiTee closed 6 years ago

SushiTee commented 6 years ago

https://github.com/humenda/GladTeX/blob/95827ce11275ca362300b044d1d0886166be7eaa/gleetex/htmlhandling.py#L428

The widht and height attribute is by definition in "px". It is not valid to write "px" in the attributes. They should be integers. If the unit is important it is possible to move the definition into the style attribute:

('<img src="{0}" style="vertical-align: {3}px; margin: 0; height: {2[height]}px; width: {2[width]}px;" alt="{1}" class="{4}" />').format(full_url, formula, pos, depth, css)