summaryrefslogtreecommitdiff
path: root/src/clarktown/renderers/quote_block.clj
blob: ee3063507db8aee46d12a711cb654e921d9814c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
(ns clarktown.renderers.quote-block
  (:require
    [clojure.string :as string]
    [clarktown.parser :as parser]))


(defn render
  "Renders a quote block."
  [block parsers]
  (let [matches (re-seq #">.*" block)
        blocks (->> (for [match matches]
                      (-> (subs match 1)
                          string/trim))
                    (string/join "\n"))
        block (parser/parse blocks parsers)]
    (str "<blockquote>" block "</blockquote>")))