perf: lazy-load images in markdown preview - #136
Conversation
|
@shrutig-blip is attempting to deploy a commit to the rinava's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
Hi @Rinava! I've addressed #43 by adding a custom image renderer that lazy-loads Markdown images while preserving the existing props and providing an empty alt fallback. I also kept the native |
93eab57 to
11e43ae
Compare
|
@shrutig-blip same story as #135 — took it over the line myself rather than leave it stuck behind the Prettier reformat. Rebuilt on today's main so the diff is just the six lines that matter; everything else in your old branch was the requote, which main already has. Kept it faithful to what you wrote — a plain lazy Verified locally and in CI — Heads-up: force-pushed onto your branch, so |
Summary
Adds a custom image renderer to the Markdown preview to improve loading performance.
Changes
imgrenderer inMarkdownPreviewloading="lazy"for off-screen imagesdecoding="async"for asynchronous image decodingsrc,title, etc.) by spreading the propsalttext to""for accessibility<img>element since Markdown images can reference arbitrary user-supplied URLs, makingnext/imageunsuitableTesting
npm run lintnpm run build