From 3f41c07ab184e2904d980d02e11ce0c2f7499f57 Mon Sep 17 00:00:00 2001 From: blankie Date: Sat, 22 Oct 2022 12:13:05 +0700 Subject: [PATCH] Loosen criteria for noscript images /stevenuniverse/wiki/Steven_Universe_Future#Gallery /stevenuniverse/wiki/Jasper#Galleries /wiki/The_Cluster#Galleries --- src/page-wiki.rkt | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/page-wiki.rkt b/src/page-wiki.rkt index 488886f..c16153b 100644 --- a/src/page-wiki.rkt +++ b/src/page-wiki.rkt @@ -57,7 +57,12 @@ (data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png") (class "thumbimage lazyload")))) (noscript - (a (@ (href "https://static.wikia.nocookie.net/nice-image.png") (class "image")) + (a (@ (href "https://static.wikia.nocookie.net/nice-image.png") (title "a nice image") (three-attribs)) + (img (@ (src "https://static.wikia.nocookie.net/nice-image-thumbnail.png") + (data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png") + (class "thumbimage"))))) + (noscript + (a (@ (href "https://static.wikia.nocookie.net/nice-image.png")) (img (@ (src "https://static.wikia.nocookie.net/nice-image-thumbnail.png") (data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png") (class "thumbimage"))))) @@ -122,8 +127,8 @@ ; remove noscript versions of images because they are likely lower quality than the script versions [(and (eq? element-type 'noscript) (match children - ; either the noscript has a.image as a first child... - [(list (list 'a (list '@ a-att ...) _)) (has-class? "image" a-att)] + ; either the noscript has an a, with attributes and an img as a first child, as a first child... + [(list (list 'a (list '@ _ ...) (list 'img _))) #t] ; or the noscript has img as a first child [(list (list 'img _)) #t] [_ #f]))