Skip to content

Commit b53c5c6

Browse files
committed
Parse wikilinks in calls to clerk/md as well
1 parent cdee8a8 commit b53c5c6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/nextjournal/clerk/parser.cljc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,8 +293,9 @@
293293

294294
(defn parse-markdown
295295
"Like `n.markdown.parser/parse` but allows to reuse the same context in successive calls"
296-
[ctx md]
297-
(markdown.parser/apply-tokens ctx (markdown/tokenize md)))
296+
([md] (parse-markdown (markdown-context) md))
297+
([ctx md]
298+
(markdown.parser/apply-tokens ctx (markdown/tokenize md))))
298299

299300
#_(parse-markdown-string {:doc? true} "# Title\nSome [[internal-link]] to be followed.")
300301

src/nextjournal/clerk/viewer.cljc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@
986986
:transform-fn (fn [wrapped-value]
987987
(-> wrapped-value
988988
mark-presented
989-
(update :nextjournal/value #(cond->> % (string? %) md/parse))
989+
(update :nextjournal/value #(cond->> % (string? %) parser/parse-markdown))
990990
(with-md-viewer)))})
991991

992992
(def code-viewer

0 commit comments

Comments
 (0)