fix(markup): resolve and proxy srcset links of <source> elements (#39708) (#39756)

Backport #39708

Co-authored-by: Basavaraj S m <basavaraj@digiscrypt.com>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
authored and GitHub committed 2026-10-13 15:46:51 +08:00
1 parent f5fd936cbb
commit 63669003eb
9 files changed
+247 -14

No files matched your search

+4 -1
View File
@@ -355,6 +355,8 @@ func visitNode(ctx *RenderContext, procs []processor, node *html.Node) *html.Nod
return visitNodeImg(ctx, node)
} else if node.Data == "video" {
return visitNodeVideo(ctx, node)
} else if node.Data == "source" {
return visitNodePictureSource(ctx, node)
}
if node.Data == "a" {
@@ -363,10 +365,11 @@ func visitNode(ctx *RenderContext, procs []processor, node *html.Node) *html.Nod
// because the content there is not processable, for example: the content is a commit id or a full URL.
procs = emojiProcessors
}
next := node.NextSibling
for n := node.FirstChild; n != nil; {
n = visitNode(ctx, procs, n)
}
return node.NextSibling
return next
}
// createKeyword() renders a highlighted version of an action keyword