hiccup.util/escape-html in hiccup does it. That function used to be in Compojure itself (since all of the functionality in hiccup used to be part of Compojure). It's a simple enough function that you could easily write it yourself though. (defn escape-html "Change special characters into HTML character entities." [text] (.. #^String (as-str text) (replace "&" "&") (replace "<" "<") (replace

