From 2314500515d9e6d14d143b240a2f68634df2f7f6 Mon Sep 17 00:00:00 2001 From: jvoisin Date: Sat, 7 Dec 2024 23:00:20 +0100 Subject: [PATCH] Merge two conditions --- internal/reader/sanitizer/sanitizer.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/internal/reader/sanitizer/sanitizer.go b/internal/reader/sanitizer/sanitizer.go index 88b5261e..21e95055 100644 --- a/internal/reader/sanitizer/sanitizer.go +++ b/internal/reader/sanitizer/sanitizer.go @@ -181,11 +181,7 @@ func sanitizeAttributes(baseURL, tagName string, attributes []html.Attribute) ([ } if tagName == "img" && (attribute.Key == "width" || attribute.Key == "height") { - if !isPositiveInteger(value) { - continue - } - - if isImageLargerThanLayout { + if isImageLargerThanLayout || !isPositiveInteger(value) { continue } }