diff --git a/internal/frontend/markdown.go b/internal/frontend/markdown.go
index 94274476d..75953973b 100644
--- a/internal/frontend/markdown.go
+++ b/internal/frontend/markdown.go
@@ -75,8 +75,8 @@ func processReadme(ctx context.Context, readme *internal.Readme, info *source.In
}, nil
}
-// rewriteImgSrc rewrites the HTML in the markdown document to replace img
-// src keys with a value that properly represents the source of the image
+// rewriteImgSrc rewrites the HTML in the markdown document to replace img and source
+// src and srcset keys with a value that properly represents the source of the image
// from the repo.
func rewriteImgSrc(doc *markdown.Document, info *source.Info, readme *internal.Readme) {
walkBlocks(doc.Blocks, func(b markdown.Block) error {
diff --git a/internal/frontend/overview.go b/internal/frontend/overview.go
index eb7bd84ce..856654f21 100644
--- a/internal/frontend/overview.go
+++ b/internal/frontend/overview.go
@@ -129,10 +129,10 @@ func translateHTML(htmlText []byte, info *source.Info, readme *internal.Readme)
// It reports whether it made a change.
func walkHTML(n *html.Node, info *source.Info, readme *internal.Readme) bool {
changed := false
- if n.Type == html.ElementNode && n.DataAtom == atom.Img {
+ if n.Type == html.ElementNode && (n.DataAtom == atom.Img || n.DataAtom == atom.Source) {
var attrs []html.Attribute
for _, a := range n.Attr {
- if a.Key == "src" {
+ if a.Key == "src" || a.Key == "srcset" {
if v := translateLink(a.Val, info, true, readme); v != "" {
a.Val = v
changed = true
diff --git a/internal/frontend/readme_test.go b/internal/frontend/readme_test.go
index 60591ed9a..0f6d89b1e 100644
--- a/internal/frontend/readme_test.go
+++ b/internal/frontend/readme_test.go
@@ -479,6 +479,42 @@ func TestReadme(t *testing.T) {
wantHTML: `