From 53f08ce7b1396368a43337b01320cf6dd263771a Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 24 Nov 2025 13:14:53 +0100 Subject: [PATCH 1/8] bump markdown --- deps.edn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.edn b/deps.edn index 88fe45603..30fc69b1c 100644 --- a/deps.edn +++ b/deps.edn @@ -7,7 +7,7 @@ weavejester/dependency {:mvn/version "0.2.1"} com.nextjournal/beholder {:mvn/version "1.0.3"} org.flatland/ordered {:mvn/version "1.15.12"} - io.github.nextjournal/markdown {:mvn/version "0.7.189"} + io.github.nextjournal/markdown {:mvn/version "0.7.201"} babashka/process {:mvn/version "0.4.16"} io.github.nextjournal/dejavu {:git/sha "7276cd9cec1bad001d595b52cee9e83a60d43bf0"} io.github.babashka/sci.nrepl {:mvn/version "0.0.2"} From 285cb2662fceedcb974d7c36d2b4d4a47d3f560e Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 24 Nov 2025 13:34:06 +0100 Subject: [PATCH 2/8] Re-enable mac cache --- .github/workflows/main.yml | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 200e289ef..5007e83aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -91,14 +91,14 @@ jobs: cli: '1.12.0.1530' bb: latest - # - name: ๐Ÿ— maven cache - # uses: actions/cache@v3 - # with: - # path: | - # ~/.m2 - # ~/.gitlibs - # ~/.deps.clj - # key: ${{ runner.os }}-maven-test-${{ hashFiles('deps.edn') }} + - name: ๐Ÿ— maven cache + uses: actions/cache@v3 + with: + path: | + ~/.m2 + ~/.gitlibs + ~/.deps.clj + key: ${{ runner.os }}-maven-test-${{ hashFiles('deps.edn') }} - name: ๐Ÿงช Run tests shell: bash run: | @@ -132,14 +132,14 @@ jobs: with: bb: latest - # - name: ๐Ÿ— maven cache - # uses: actions/cache@v3 - # with: - # path: | - # ~/.m2 - # ~/.gitlibs - # ~/.deps.clj - # key: ${{ runner.os }}-maven-test-${{ hashFiles('deps.edn') }}-${{ hashFiles('bb.edn') }} + - name: ๐Ÿ— maven cache + uses: actions/cache@v3 + with: + path: | + ~/.m2 + ~/.gitlibs + ~/.deps.clj + key: ${{ runner.os }}-maven-test-${{ hashFiles('deps.edn') }}-${{ hashFiles('bb.edn') }} - name: ๐Ÿงช Run tests shell: bash From 48bdb6b230d30cc783e2b230b61ca7baafbaad34 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 24 Nov 2025 17:57:36 +0100 Subject: [PATCH 3/8] reduce diff --- src/nextjournal/clerk/parser.cljc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/nextjournal/clerk/parser.cljc b/src/nextjournal/clerk/parser.cljc index bdf337f53..afd55b55d 100644 --- a/src/nextjournal/clerk/parser.cljc +++ b/src/nextjournal/clerk/parser.cljc @@ -435,7 +435,6 @@ ([{:as opts :keys [skip-doc?]} initial-state s] (binding [*ns* (:ns initial-state *ns*)] (loop [{:as state :keys [nodes blocks block-settings add-comment-on-line? add-block-id]} - (assoc initial-state :nodes (:children (try (p/parse-string-all s) (catch Exception e @@ -471,8 +470,9 @@ :settings (merge-settings next-block-settings (parse-local-block-settings form)) :text nstring :form (add-loc opts loc form) - :loc loc}] - (when (ns? form) + :loc loc} + ns? (ns? form)] + (when ns? (eval form)) (cond-> (-> state (assoc :add-comment-on-line? true) @@ -480,7 +480,8 @@ (assoc :block-settings next-block-settings) (update :blocks conj (add-block-id code-block))) (not (contains? state :ns)) - (assoc :ns *ns*))) + (assoc :ns *ns*) + ns? (update :md-context merge (:nextjournal.clerk/markdown (meta *ns*))))) (and add-comment-on-line? (whitespace-on-line-tags (n/tag node))) (-> state (assoc :add-comment-on-line? (not (n/comment? node))) From 8ddf7d75581e28e4d3df479123ba16d68ed679a7 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 24 Nov 2025 20:10:05 +0100 Subject: [PATCH 4/8] test --- test/nextjournal/clerk/parser_test.clj | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/nextjournal/clerk/parser_test.clj b/test/nextjournal/clerk/parser_test.clj index d7a5a2d9b..4bcf3c1c8 100644 --- a/test/nextjournal/clerk/parser_test.clj +++ b/test/nextjournal/clerk/parser_test.clj @@ -46,7 +46,12 @@ line\""}] (testing "reading a bad block shows block and file info in raised exception" (is (thrown-match? clojure.lang.ExceptionInfo {:file string?} - (parser/parse-clojure-string {:doc? true :file "foo.clj"} "##boom"))))) + (parser/parse-clojure-string {:doc? true :file "foo.clj"} "##boom")))) + (testing "markdown settings" + (is (= "$1 + $2 = $3" + (-> (parser/parse-clojure-string "(ns foo {:nextjournal.clerk/markdown {:disable-inline-formulas true}}) +;; $1 + $2 = $3") + :blocks second :doc :content first :content first :text))))) (deftest parse-inline-comments (is (match? {:blocks [{:doc {:content [{:content [{:text "text before"}]}]}} From a95270baaa942cff063d317b2ccdab379e21b7e2 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 25 Nov 2025 20:18:37 +0100 Subject: [PATCH 5/8] Bump --- deps.edn | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deps.edn b/deps.edn index fcbbdcec1..b35b69d96 100644 --- a/deps.edn +++ b/deps.edn @@ -7,7 +7,7 @@ weavejester/dependency {:mvn/version "0.2.1"} com.nextjournal/beholder {:mvn/version "1.0.3"} org.flatland/ordered {:mvn/version "1.15.12"} - io.github.nextjournal/markdown {:mvn/version "0.7.201"} + io.github.nextjournal/markdown {:mvn/version "0.7.213"} babashka/process {:mvn/version "0.4.16"} io.github.nextjournal/dejavu {:git/sha "7276cd9cec1bad001d595b52cee9e83a60d43bf0"} io.github.babashka/sci.nrepl {:mvn/version "0.0.2"} From 9dde71bbb35d408031d0dbb20ebbf2e06dbe7c64 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 25 Nov 2025 22:06:05 +0100 Subject: [PATCH 6/8] dev build --- .github/workflows/main.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5007e83aa..8143ecd4e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -144,7 +144,9 @@ jobs: - name: ๐Ÿงช Run tests shell: bash run: | - bb test:bb + # temporarily using dev build because of https://github.com/babashka/sci/issues/1011 + bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir . + ./bb test:bb static-build: runs-on: ubuntu-latest From 1faef02cf5f26a9ad42908ce2c8853dec5de0d9d Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Tue, 25 Nov 2025 22:07:24 +0100 Subject: [PATCH 7/8] tmp bb --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8143ecd4e..bce2b76fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -145,8 +145,8 @@ jobs: shell: bash run: | # temporarily using dev build because of https://github.com/babashka/sci/issues/1011 - bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir . - ./bb test:bb + bash <(curl https://raw.githubusercontent.com/babashka/babashka/master/install) --dev-build --dir /tmp + /tmp/bb test:bb static-build: runs-on: ubuntu-latest From 714d69935ed78c1492612ab0bead6f3bfd741c19 Mon Sep 17 00:00:00 2001 From: Michiel Borkent Date: Mon, 1 Dec 2025 17:21:02 +0100 Subject: [PATCH 8/8] bump markdown --- deps.edn | 2 +- src/nextjournal/clerk/parser.cljc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/deps.edn b/deps.edn index b35b69d96..b02b1757f 100644 --- a/deps.edn +++ b/deps.edn @@ -7,7 +7,7 @@ weavejester/dependency {:mvn/version "0.2.1"} com.nextjournal/beholder {:mvn/version "1.0.3"} org.flatland/ordered {:mvn/version "1.15.12"} - io.github.nextjournal/markdown {:mvn/version "0.7.213"} + io.github.nextjournal/markdown {:mvn/version "0.7.222"} babashka/process {:mvn/version "0.4.16"} io.github.nextjournal/dejavu {:git/sha "7276cd9cec1bad001d595b52cee9e83a60d43bf0"} io.github.babashka/sci.nrepl {:mvn/version "0.0.2"} diff --git a/src/nextjournal/clerk/parser.cljc b/src/nextjournal/clerk/parser.cljc index afd55b55d..144e9eaa4 100644 --- a/src/nextjournal/clerk/parser.cljc +++ b/src/nextjournal/clerk/parser.cljc @@ -481,7 +481,7 @@ (update :blocks conj (add-block-id code-block))) (not (contains? state :ns)) (assoc :ns *ns*) - ns? (update :md-context merge (:nextjournal.clerk/markdown (meta *ns*))))) + ns? (update-in [:md-context :opts] merge (:nextjournal.clerk/markdown (meta *ns*))))) (and add-comment-on-line? (whitespace-on-line-tags (n/tag node))) (-> state (assoc :add-comment-on-line? (not (n/comment? node)))