Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
erdos committed Nov 4, 2023
1 parent a12a9b3 commit 1fb8dbd
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/stencil/merger.clj
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,14 @@
;; only fragment includes are evaluated
(def ^:dynamic *only-includes* false)

(defn map-action-token [token]
(if-let [action (:action token)]
(let [parsed (tokenizer/text->cmd action)
parsed (assoc parsed :raw (str open-tag action close-tag))]
(if (and *only-includes*
(not= :cmd/include (:cmd parsed)))
{:text (str open-tag action close-tag)}
{:action parsed}))
token))
(defn map-action-token [{:keys [action]}]
(let [parsed (tokenizer/text->cmd action)
source (str open-tag action close-tag)
parsed (assoc parsed :raw source)]
(if (and *only-includes*
(not= :cmd/include (:cmd parsed)))
{:text source}
{:action parsed})))

(defn- map-text-nodes [rf]
(fn ([acc] (rf acc))
Expand Down

0 comments on commit 1fb8dbd

Please sign in to comment.