1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +00:00

feat(sanitizer): allow img tags with only a srcset and no src attribute

This commit is contained in:
Frédéric Guillot 2025-02-15 17:57:01 -08:00
parent 991c54150d
commit 462ba8d7f7
2 changed files with 13 additions and 3 deletions

View file

@ -296,9 +296,9 @@ func hasRequiredAttributes(tagName string, attributes []string) bool {
switch tagName {
case "a":
return slices.Contains(attributes, "href")
case "iframe", "img":
case "iframe":
return slices.Contains(attributes, "src")
case "source":
case "source", "img":
return slices.Contains(attributes, "src") || slices.Contains(attributes, "srcset")
default:
return true