From 43cc1230576ed43321c4f671b4a146674572357d Mon Sep 17 00:00:00 2001 From: Jaidyn Ann <10477760+JadedCtrl@users.noreply.github.com> Date: Wed, 29 May 2024 21:55:59 -0500 Subject: [PATCH] Fix URL-substitions with some tags () --- src/mirror-img.lisp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mirror-img.lisp b/src/mirror-img.lisp index 850c486..3566ae4 100644 --- a/src/mirror-img.lisp +++ b/src/mirror-img.lisp @@ -64,7 +64,7 @@ For example: (linked-urls dom :tags tags)))) ;; lquery-dom alist list → nil -(defun substitute-urls (dom substitution-alist &key (tags '("img"))) +(defun substitute-urls (dom substitution-alist &key (tags *default-tags*)) "Replace SRC or HREF attributes of certain tags in an LQuery DOM, based on a substitution associative list. The substitution alist is made up of cons-cells mapping replacee URLs to substition URLs. @@ -125,10 +125,11 @@ HREF and SRC attributes." "Set the SRC or HREF attribute of an LQuery node (based on which attribute is already set)." (and node - (if (lquery-funcs:attr node "src") - (lquery-funcs:attr node "src" url)) - (if (lquery-funcs:attr node "href") - (lquery-funcs:attr node "href" url)))) + (cond ((lquery-funcs:attr node "src") + (lquery-funcs:attr node "src" url)) + ((lquery-funcs:attr node "href") + (lquery-funcs:attr node "href" url)) + ('T node))))