Commit Graph

8 Commits

Author SHA1 Message Date
Tim Abbott
2c8d74735a postprocess_content: Drop invalid inline image elements.
These shouldn't exist without bugs in the Markdown processor, but at
least some ancient messages in chat.zulip.org seem to have them.
2025-02-25 22:40:36 -08:00
Abel Abate
2e95012c90 postprocess: Fix animated images automatically playing on Firefox.
This commit fixes a bug where animated images automatically play on
Firefox because the image source didn't output the same URL across
different browsers. Currently, the image source is normalized to
ensure consistent URLs across different browsers.

Fixes #33248

Co-authored-by: Alex Vandiver <alexmv@zulip.com>
2025-02-18 22:08:00 -08:00
Karl Stolley
be5c81286c rendered_markdown: Offset ordered lists by start and count.
Fixes #33424
2025-02-12 10:32:26 -08:00
Anders Kaseorg
ec3177c834 web: Add explicit extensions to imports.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-11-13 09:18:56 -08:00
Alex Vandiver
b8e4bdccd8 postprocess_content: Un-URI-escape filename in title.
The filename contains URI-escaped characters, which do not need to be
escaped for safety -- they only make the filename in the tooltip less
readable.
2024-08-29 13:29:33 -07:00
Alex Vandiver
2f2803431d thumbnails: Mark images as lazy-loaded.
Setting `loading=lazy`[^1] tells the browser to defer loading the
image until it is near enough to the viewport to merit loading.  This
can save a great deal of image fetching.

[^1]: https://html.spec.whatwg.org/multipage/urls-and-fetching.html#lazy-loading-attributes
2024-08-16 14:33:25 -07:00
Anders Kaseorg
94fe3f6194 rendered_markdown: Move thumbnail rewriting to postprocess_content.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-23 13:26:37 -07:00
Anders Kaseorg
edf34ada63 util: Rename clean_user_content_links to postprocess_content.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2024-07-23 13:26:37 -07:00