From caffe692c8d715b30c8851ab8210dbabb19a1785 Mon Sep 17 00:00:00 2001 From: Berkeley Martinez Date: Sat, 16 Mar 2024 15:11:04 -0600 Subject: [PATCH] feat: add pre/clode language-xxx class to code blocks (#97) * feat: add pre/clode language-xxx class to code blocks * chore: update CHANGELOG * chore: update markdown-clj --- .gitignore | 4 ++++ CHANGELOG.md | 1 + deps.edn | 2 +- src/quickblog/internal.clj | 5 ++++- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 99452e9..04966e7 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,7 @@ classes /templates/ /posts/ .cache +.clj-kondo +.nrepl-port +.direnv +.envrc diff --git a/CHANGELOG.md b/CHANGELOG.md index 3276597..33536f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ Instances of quickblog can be seen here: - Add `--date` to api/new. ([@jmglov](https://github.com/jmglov)) - Support Selmer template for new posts in api/new; see [Templates > New posts](README.md#new-posts) in README. ([@jmglov](https://github.com/jmglov)) +- Add 'language-xxx' to pre/code blocks ## 0.3.6 (2031-12-31) diff --git a/deps.edn b/deps.edn index be22505..c262f81 100644 --- a/deps.edn +++ b/deps.edn @@ -4,7 +4,7 @@ org.clojure/clojure {:mvn/version "1.11.1"} org.clojure/data.xml {:mvn/version "0.2.0-alpha6"} selmer/selmer {:mvn/version "1.12.53"} - markdown-clj/markdown-clj {:mvn/version "1.11.7"} + markdown-clj/markdown-clj {:mvn/version "1.12.0"} org.babashka/cli {:mvn/version "0.6.50"} org.babashka/http-server {:mvn/version "0.1.11"} babashka/babashka.pods {:git/url "https://github.com/babashka/pods" diff --git a/src/quickblog/internal.clj b/src/quickblog/internal.clj index 084ea77..09c61dc 100644 --- a/src/quickblog/internal.clj +++ b/src/quickblog/internal.clj @@ -139,7 +139,10 @@ :footnotes? true :code-style (fn [lang] - (format "class=\"lang-%s\"" lang))) + (format "class=\"lang-%s language-%s\"" lang lang)) + :pre-style + (fn [lang] + (format "class=\"language-%s\"" lang))) :html post-process-markdown)))