Skip to content

Conversation

@macuzi
Copy link
Contributor

@macuzi macuzi commented Mar 13, 2023

PR App Fix CX-151

🧰 Changes

Used the correct value for the align attribute. Chrome for some reason allows images to be centered via [align=center]. But this isn't strictly correct: The Image Embed element | MDN

Firefox only recognizes 'middle' and not 'center'.

🧬 QA & Testing

@macuzi macuzi requested review from a team, thenaomiday and trishaprile and removed request for a team March 13, 2023 21:31
@github-actions
Copy link

github-actions bot commented Mar 13, 2023

A review app has been launched for this PR! Image

🔍 Inspect the app: https://dashboard.heroku.com/apps/markdown-pr-721

🧭 Take it for a spin: https://markdown-pr-721.herokuapp.com/

  • Shut down on Mon Apr 3: Since this PR is closed, its review app has been cleaned up. 🧽

Copy link
Contributor

@trishaprile trishaprile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice fix!

@gkoberger gkoberger merged commit 6a62281 into next Apr 3, 2023
@gkoberger gkoberger deleted the fix-image-align branch April 3, 2023 14:51
@rafegoldberg
Copy link
Contributor

rafegoldberg commented Apr 13, 2023

@macuzi—You're quite right that "center" isn't technically a valid value for the [align] attribute, but we actually accept it1 within RDMD. The distinction between the two is that…

  • setting [align=middle] will align the image vertically to the center of the line's y axis.2
  • setting [align=center] will force the image to be centered horizontally in it's container.1

These changes could possibly have some strange effects on how users image blocks are rendered, so unfortunately I think we have to revert this PR.

Footnotes

  1. that is, we style on it to force the image to display as a block-level element 2

  2. this assumes the image is displayed as an inline-block, which is the default

rafegoldberg added a commit that referenced this pull request Apr 13, 2023
rafegoldberg pushed a commit that referenced this pull request Apr 14, 2023
## Version 6.61.1

### 🛠 Fixes & Updates

* centering in firefox ([#721](#721)) ([6a62281](6a62281))
* **image:** force SVG dimensions in lightbox ([#734](#734)) ([71fc4e5](71fc4e5))

<!--SKIP CI-->
@rafegoldberg
Copy link
Contributor

Image

This PR was released!

🚀 Changes included in v6.61.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants