Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (20 sloc) 645 Bytes
(ns incise.parsers.impl.markdown
(:require (incise.parsers [core :as pc]
[html :refer [html-parser]])
[incise.config :as conf]
[me.raynes.cegdown :as md]))
(def ^:private default-extensions
[:fenced-code-blocks
:autolinks
:quotes
:abbreviations
:tables
:definition-lists
:strikethrough
:smartypants])
(defn- get-extensions []
(conf/get-in [:parsers :markdown :extensions] default-extensions))
(defn- markdown-to-html [markdown-str]
(md/to-html markdown-str (get-extensions)))
(def parser (html-parser markdown-to-html))
(pc/register [:md :markdown] #'parser)