Skip to content

Commit 48bdb6b

Browse files
committed
reduce diff
1 parent 27fa63a commit 48bdb6b

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nextjournal/clerk/parser.cljc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,6 @@
435435
([{:as opts :keys [skip-doc?]} initial-state s]
436436
(binding [*ns* (:ns initial-state *ns*)]
437437
(loop [{:as state :keys [nodes blocks block-settings add-comment-on-line? add-block-id]}
438-
439438
(assoc initial-state
440439
:nodes (:children (try (p/parse-string-all s)
441440
(catch Exception e
@@ -471,16 +470,18 @@
471470
:settings (merge-settings next-block-settings (parse-local-block-settings form))
472471
:text nstring
473472
:form (add-loc opts loc form)
474-
:loc loc}]
475-
(when (ns? form)
473+
:loc loc}
474+
ns? (ns? form)]
475+
(when ns?
476476
(eval form))
477477
(cond-> (-> state
478478
(assoc :add-comment-on-line? true)
479479
(update :nodes rest)
480480
(assoc :block-settings next-block-settings)
481481
(update :blocks conj (add-block-id code-block)))
482482
(not (contains? state :ns))
483-
(assoc :ns *ns*)))
483+
(assoc :ns *ns*)
484+
ns? (update :md-context merge (:nextjournal.clerk/markdown (meta *ns*)))))
484485
(and add-comment-on-line? (whitespace-on-line-tags (n/tag node)))
485486
(-> state
486487
(assoc :add-comment-on-line? (not (n/comment? node)))

0 commit comments

Comments
 (0)