This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-03-23
Channels
- # babashka (15)
- # beginners (102)
- # biff (4)
- # calva (15)
- # cider (51)
- # clojure (5)
- # clojure-dev (3)
- # clojure-europe (3)
- # clojure-france (1)
- # clojure-india (1)
- # clojure-korea (2)
- # clojure-norway (13)
- # clojurescript (20)
- # data-science (1)
- # datalevin (6)
- # datascript (2)
- # emacs (3)
- # events (2)
- # fulcro (4)
- # gratitude (2)
- # introduce-yourself (8)
- # lsp (3)
- # malli (1)
- # meander (1)
- # nbb (9)
- # off-topic (11)
- # releases (1)
- # ring (1)
- # yamlscript (5)
(m/search [:article
[:div
[:nav
[:div
[:p "foo"]
[:p "foo"]]]]
[:div
[:div
[:p "foo"]]]]
[:article
. _ ...
(m/$ [(m/not :nav)
. _ ...
(m/$ [:p & _ :as ?el])
. _ ...])
. _ ...]
?el)
I’m trying to get all the :p
tags that are not descendants of :nav
tags. I’m using m/not
and I understand why it doesn’t work, because it can be satisfied with a :div
tag before it sees a :nav
tag.
Effectively, what I’m looking for is m/never
that makes m/$
not return a match if it encounters a :nav
tag.
Is there some mechanism/operator in Meander to achieve this?
Basically, how would you write “never a descendant of” in meander.
Thanks.