Skip to content

Commit

Permalink
Blockquote
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Apr 4, 2024
1 parent 4ab0440 commit 60f5236
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/nextjournal/markdown/parser2.clj
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@

;; helpers / ctx
(def ^:dynamic *in-tight-list?* false)
(defn paragraph-type [] (if *in-tight-list?* :plain :paragrpah))
(defn paragraph-type [] (if *in-tight-list?* :plain :paragraph))
(defn in-tight-list? [node] (if (instance? ListBlock node) (.isTight ^ListBlock node) *in-tight-list?*))
(defmacro with-tight-list [node & body]
`(binding [*in-tight-list?* (in-tight-list? ~node)]
Expand All @@ -105,6 +105,9 @@
(defmethod open-node Paragraph [loc _node]
(-> loc (z/append-child {:type (paragraph-type) :content []}) z/down z/rightmost))

(defmethod open-node BlockQuote [loc _node]
(-> loc (z/append-child {:type :blockquote :content []}) z/down z/rightmost))

(defmethod open-node Heading [loc ^Heading node]
(-> loc (z/append-child {:type :heading :content [] :level (.getLevel node)}) z/down z/rightmost))

Expand Down Expand Up @@ -195,8 +198,8 @@
(parse "some `marks` inline")
(parse "# Ahoi
par
broken
> par
> broken
* a tight **strong** list
* with [a nice link](/to/some 'with a title')
Expand Down

0 comments on commit 60f5236

Please sign in to comment.