Skip to content

Commit 7b26676

Browse files
committed
Fix showing var text
1 parent 4317161 commit 7b26676

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

notebooks/parsing_extensibility.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,7 @@
1111

1212
^{:nextjournal.clerk/visibility {:code :hide :result :hide}}
1313
(def show-text
14-
{:var-from-def? true
15-
:transform-fn (fn [{{::clerk/keys [var-from-def]} :nextjournal/value}] (clerk/html [:pre @var-from-def]))})
14+
{:transform-fn (fn [x] (clerk/html [:pre (deref (:nextjournal/value x))]))})
1615

1716
;; With recent additions to our `nextjournal.markdown.parser` we're allowing for a customizable parsing layer on top of the tokenization provided by `markdown-it` ([n.markdown/tokenize](https://github.com/nextjournal/markdown/blob/ae2a2f0b6d7bdc6231f5d088ee559178b55c97f4/src/nextjournal/markdown.clj#L50-L52)).
1817
;; We're acting on the text (leaf) tokens, splitting each of those into a collection of [nodes](https://github.com/nextjournal/markdown/blob/ff68536eb15814fe81db7a6d6f11f049895a4282/src/nextjournal/markdown/parser.cljc#L5). We'll explain how that works by means of three examples.

0 commit comments

Comments
 (0)