From 955fb0824a09d3ba72d99ff51c03eaae6fd7eef1 Mon Sep 17 00:00:00 2001 From: Axel Verhaeghe Date: Tue, 30 Sep 2025 08:51:34 +0200 Subject: [PATCH] feat(reader): simplify blur query param checking --- internal/reader/rewrite/content_rewrite_functions.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/internal/reader/rewrite/content_rewrite_functions.go b/internal/reader/rewrite/content_rewrite_functions.go index 6416fe79..1fcb7b9c 100644 --- a/internal/reader/rewrite/content_rewrite_functions.go +++ b/internal/reader/rewrite/content_rewrite_functions.go @@ -570,16 +570,10 @@ func stripImageQueryParams(entryContent string) string { // Only strip query parameters if this is a blurry placeholder image if parsedURL.RawQuery != "" { - queryParams, err := url.ParseQuery(parsedURL.RawQuery) - if err != nil { - return - } - // Check if there's a blur parameter with a non-zero value - blurValues, hasBlur := queryParams["blur"] - if hasBlur && len(blurValues) > 0 { - blurValue, err := strconv.Atoi(blurValues[0]) - if err == nil && blurValue > 0 { + blurValue := parsedURL.Query().Get("blur") + if blurValue != "" { + if blurInt, err := strconv.Atoi(blurValue); err == nil && blurInt > 0 { parsedURL.RawQuery = "" img.SetAttr("src", parsedURL.String()) changed = true