Update appearance of external links

This commit is contained in:
Cadence Ember
2025-11-10 19:09:24 +13:00
parent c93c901ad3
commit 0524e60d5d
3 changed files with 16 additions and 5 deletions

View File

@@ -235,6 +235,16 @@
(eq? element-type 'use))
element))))
return-no-element]
; svg icon for external links
[(and (eq? element-type 'a)
(dict-has-key? attributes 'href)
(not (string-contains? (car (dict-ref attributes 'href)) "wikipedia.org"))
(or (has-class? "extiw" attributes) (has-class? "external" attributes)))
`(,element-type
,attributes
(,@children
(svg (@ (fill "currentColor") (width "12") (height "12") (viewBox "0 0 12 12") (class "external"))
(path (@ (d "M6 1h5v5L8.86 3.85 4.7 8 4 7.3l4.15-4.16zM2 3h2v1H2v6h6V8h1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1"))))))]
; exclude infobox items that are videos, and gallery items that are videos
[(and (or (has-class? "pi-item" attributes)
(has-class? "wikia-gallery-item" attributes))