all repos — archive/microformats @ 388a6a07086c4217a907a8643b27693618c008f2

Incomplete Clojure microformats library

cond-let: use % instead of x as anaphor

Alan Pearce
commit

388a6a07086c4217a907a8643b27693618c008f2

parent

648699e0c15773bc332b2876ad0aa21c897e3654

1 file changed, 5 insertions(+), 5 deletions(-)

changed files
M src/microformats/parser.cljsrc/microformats/parser.clj
@@ -6,7 +6,7 @@
(defmacro cond-let [& clauses] (when clauses - (list 'if-let ['x (first clauses)] + (list 'if-let ['% (first clauses)] (if (next clauses) (second clauses) (throw (IllegalArgumentException.
@@ -179,13 +179,13 @@ :abbr (-> element :attrs :title)
:img (-> element :attrs :alt) (cond-let (first (html/select element [html/root :> [:img html/only-child]])) - (-> x :attrs :alt) + (-> % :attrs :alt) (first (html/select element [html/root :> [:abbr html/only-child (html/attr? :title)]])) - (-> x :attrs :title) + (-> % :attrs :title) (first (html/select element [html/root :> html/only-child :> [:img html/only-child]])) - (-> x :attrs :alt) + (-> % :attrs :alt) (first (html/select element [html/root :> html/only-child :> [:abbr html/only-child (html/attr? :title)]])) - (-> x :attrs :title) + (-> % :attrs :title) true (node-to-text (:content element))))) (defn- imply-url