       condition
       (:content second-block)
       
-      :else [""])
+      :else [(TextNode. "")])
     context-map))
 
 (defn if-handler [[condition] rdr]

(def ^Character filter-close \})
(def ^Character tag-second \%)

(def templates (atom {}))

(declare parse expr-tag tag-content)

(defn render [template args]
  (let [buf (StringBuilder.)]
    (doseq [element template]
      (.append buf (if (string? element) element (element args))))
    (.toString buf)))

(defn render-file [filename args]
  (let [{:keys [template last-modified]} (get @templates filename)
        last-modified-file (.lastModified (java.io.File. filename))]
    (if (and last-modified (= last-modified last-modified-file))
      (render template args)
      (let [template (parse filename)]
        (swap! templates assoc filename {:template template
                                         :last-modified last-modified-file})
        (render template args)))))

(defn read-char [rdr]
  (let [ch (.read rdr)]
    (if-not (== -1 ch) (char ch))))


              (do
                ;we hit a tag so we append the buffer content to the template
                ; and empty the buffer, then we proceed to parse the tag
                (conj! template (TextNode. (.toString buf)))
                (.setLength buf 0)
                (conj! template (FunctionNode. (parse-tag (read-tag-info rdr) rdr)))
                (recur (read-char rdr)))
              (do
                ;default case, here we simply append the character and
