summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoreltrac <hi@eltr.ac>2026-10-09 16:48:15 +0800
committereltrac <hi@eltr.ac>2026-10-09 18:11:36 +0800
commite3540033411524c506c85b2566fd525d8ed6ae7f (patch)
treeff0a665182353febc5b2f203f296100ffb4e6b74 /src
parente9d938760a7b97f5835b11ad779b1dc84ee53d22 (diff)
mf.searcher: find-type now recursively search in children
add recursive find-type tests
Diffstat (limited to 'src')
-rw-r--r--src/weepinbell/microformats/searcher.clj3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/weepinbell/microformats/searcher.clj b/src/weepinbell/microformats/searcher.clj
index 0f7150a..480b6ad 100644
--- a/src/weepinbell/microformats/searcher.clj
+++ b/src/weepinbell/microformats/searcher.clj
@@ -58,7 +58,8 @@
:else nil))
(defn find-type [mftype items]
- (filter #(some #{mftype} (type-vector %)) items))
+ (concat (filter #(some #{mftype} (type-vector %)) items)
+ (mapcat #(find-type mftype (:children %)) items)))
(def find-h-entries (partial find-type "h-entry"))
(def find-h-cards (partial find-type "h-card"))