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))))