Selecting nodes by attribute name with case-insensitivity

27 views
Skip to first unread message

neverfox

unread,
Jul 26, 2015, 12:01:21 PM7/26/15
to Enlive
For the life of me, I cannot figure this one out. I need to select the meta description from the head but the name could be either "description" or "DESCRIPTION", so simply using `attr=` won't cover both cases. I've tried writing custom predicates without success, mainly because the documentation on exactly how they need to be written is sketchy at best.

What I had:
(html/select head [[:meta (html/attr= :name "description"]])

What I need:
(html/select head [[:meta some-predicate-that-is-case-insensitive]])

Any help would be appreciated.
Reply all
Reply to author
Forward
0 new messages