forked from cadence/breezewiki
Loosen criteria for noscript images
/stevenuniverse/wiki/Steven_Universe_Future#Gallery /stevenuniverse/wiki/Jasper#Galleries /wiki/The_Cluster#Galleries
This commit is contained in:
parent
71705d6e74
commit
43e6b204a0
1 changed files with 9 additions and 2 deletions
|
@ -61,6 +61,11 @@
|
||||||
(img (@ (src "https://static.wikia.nocookie.net/nice-image-thumbnail.png")
|
(img (@ (src "https://static.wikia.nocookie.net/nice-image-thumbnail.png")
|
||||||
(data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png")
|
(data-src "https://static.wikia.nocookie.net/nice-image-thumbnail.png")
|
||||||
(class "thumbimage")))))
|
(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")))))
|
||||||
(figcaption "Test figure!"))
|
(figcaption "Test figure!"))
|
||||||
(iframe (@ (src "https://example.com/iframe-src")))))))
|
(iframe (@ (src "https://example.com/iframe-src")))))))
|
||||||
|
|
||||||
|
@ -122,10 +127,12 @@
|
||||||
; remove noscript versions of images because they are likely lower quality than the script versions
|
; remove noscript versions of images because they are likely lower quality than the script versions
|
||||||
[(and (eq? element-type 'noscript)
|
[(and (eq? element-type 'noscript)
|
||||||
(match children
|
(match children
|
||||||
; either the noscript has a.image as a first child...
|
; the noscript has a.image as a first child...
|
||||||
[(list (list 'a (list '@ a-att ...) _)) (has-class? "image" a-att)]
|
[(list (list 'a (list '@ a-att ...) _)) (has-class? "image" a-att)]
|
||||||
; or the noscript has img as a first child
|
; or the noscript has img as a first child...
|
||||||
[(list (list 'img _)) #t]
|
[(list (list 'img _)) #t]
|
||||||
|
; or the noscript has an a, with an img as a first child, as a first child
|
||||||
|
[(list (list 'a (list 'img _)))] #t]
|
||||||
[_ #f]))
|
[_ #f]))
|
||||||
return-no-element]
|
return-no-element]
|
||||||
[#t
|
[#t
|
||||||
|
|
Loading…
Reference in a new issue