              :class-name "emoji"}]
       e)))
 
-(register-enricher! emoji-regex emoji-converter)
+(def emoji-enricher (make-enricher emoji-regex emoji-converter))
+(register-enricher! emoji-enricher)
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;; Markup

            [clojure.set :refer [subset?]])
  (:import [goog Uri]))

(def enrichers (atom []))

(defn make-enricher
  [regex match-converter]

                  (concat (map match-converter (persistent! matches)) [""])))))

(defn register-enricher!
  [enricher]
  (swap! all-enrichers conj enricher))

(defn enrich-text-with
  [enrichers s]
  (let [result (atom [s])]
    (doseq [f enrichers]
      (swap! result #(mapcat (fn [v]
                               (if (string? v)
                                 (f v)
                                 [v])) %)))
    (filter (complement empty?) @result)))

(def enrich-text (memoize (fn [s]
                            (enrich-text-with @all-enrichers s))))

(defn make-external-link
  [url]
