Search code examples
clojureenlive

How to make identity transformation in enlive?


I need to replace content of an element based on some condition. If condition is not met the element should be untouched.

(enlive/deftemplate template (io/resource "templ.html")
  []
  [:#el_id] (if (condition)
              (enlive/content ...)
              ;; otherwise identity transformation here
              ))

I tried to use nil as identity transformation, but it just removes the element.


Solution

  • identity function does the job. Sorry for messing you around.