Skip to content

Commit

Permalink
Parse wikilinks in calls to clerk/md as well
Browse files Browse the repository at this point in the history
  • Loading branch information
zampino committed Aug 29, 2023
1 parent 6d001a0 commit c6b3ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/nextjournal/clerk/parser.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,9 @@

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

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

Expand Down
2 changes: 1 addition & 1 deletion src/nextjournal/clerk/viewer.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,7 @@
:transform-fn (fn [wrapped-value]
(-> wrapped-value
mark-presented
(update :nextjournal/value #(cond->> % (string? %) md/parse))
(update :nextjournal/value #(cond->> % (string? %) parser/parse-markdown))
(with-md-viewer)))})

(def code-viewer
Expand Down

0 comments on commit c6b3ea5

Please sign in to comment.