summaryrefslogtreecommitdiff
path: root/src/clarktown/renderers/quote_block.clj
diff options
context:
space:
mode:
Diffstat (limited to 'src/clarktown/renderers/quote_block.clj')
-rw-r--r--src/clarktown/renderers/quote_block.clj16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/clarktown/renderers/quote_block.clj b/src/clarktown/renderers/quote_block.clj
new file mode 100644
index 0000000..ee30635
--- /dev/null
+++ b/src/clarktown/renderers/quote_block.clj
@@ -0,0 +1,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>")))