Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: image dimensions must be specified in CSS style attribute (option parseImgDimensions) #955

Open
wintifrosch opened this issue Oct 14, 2022 · 0 comments

Comments

@wintifrosch
Copy link

The current implementation is broken.
To retain backwards compatibility, the showdown option should add a style attribute (CSS) instead of the height and width attributes in HTML.

Background information

  • The <img with="..." height="..."> attributes in HTML5 are not used like in the old days anymore (before css). Nowadays, the rendered dimensions should be specified in CSS. According to HTML5 spec, the attributes must contain integer values only.¹
  • Current browsers don't interpret image sizes specified in em (and other units) any more. The unit is ignored, the value is interpreted as a pixel dimension, which is really not what was intended.

image

¹ Read more in a discussion from 2016 in Stackoverflow
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant