Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

postprocess_content: Simplify math and improve comment.

Karl Stolleyb0cada3cb0e9
diff --git a/web/src/postprocess_content.ts b/web/src/postprocess_content.ts
index 0a8d799e4c7..93564604bf5 100644
--- a/web/src/postprocess_content.ts
+++ b/web/src/postprocess_content.ts
@@ -310,14 +310,14 @@ export function postprocess_content(html: string): string {
// Despite setting `width` and `height` values above, the
// flexbox gallery collapses until images have loaded. We
- // therefore have to avoid the layout shift that would
- // otherwise cause by setting the only the width attribute
- // here. And by setting this value in ems, we ensure that
+ // therefore have to prevent a layout shift that would
+ // otherwise happen by setting the width attribute here.
+ // And by setting this value in ems, we ensure that
// images scale as users adjust the information-density
// settings.
message_media_image.style.setProperty(
"width",
- `${(image_box_em * font_size_in_use * original_width) / original_height / font_size_in_use}em`,
+ `${(image_box_em * original_width) / original_height}em`,
);
if (is_dinky_image) {