branch: elpa/clojure-ts-mode
commit 63a9ea47c8365532f67a4112eea5111b27d880b5
Author: Roman Rudakov <rruda...@fastmail.com>
Commit: Bozhidar Batsov <bozhi...@batsov.dev>

    Improve markdown highlighting in the docstrings
---
 CHANGELOG.md                |  1 +
 Eldev                       |  2 +-
 clojure-ts-mode.el          |  9 ++++++++-
 test/samples/docstrings.clj | 11 ++++++++++-
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2ce075e42a..627b567dc4 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -21,6 +21,7 @@
 - [#76](https://github.com/clojure-emacs/clojure-ts-mode/pull/76): Improve 
performance of semantic indentation by caching rules.
 - [#74](https://github.com/clojure-emacs/clojure-ts-mode/issues/74): Add imenu 
support for keywords definitions.
 - [#77](https://github.com/clojure-emacs/clojure-ts-mode/issues/77): Update 
grammars to the latest versions.
+- [#79](https://github.com/clojure-emacs/clojure-ts-mode/pull/79): Improve 
markdown highlighting in the docstrings.
 
 ## 0.2.3 (2025-03-04)
 
diff --git a/Eldev b/Eldev
index 7a30881571..b70457108f 100644
--- a/Eldev
+++ b/Eldev
@@ -17,7 +17,7 @@
 (setq checkdoc-permit-comma-termination-flag t)
 (setq checkdoc--interactive-docstring-flag nil)
 
-(setf eldev-lint-default '(elisp))
+(setq eldev-lint-default-excluded '(package))
 
 (with-eval-after-load 'elisp-lint
   ;; We will byte-compile with Eldev.
diff --git a/clojure-ts-mode.el b/clojure-ts-mode.el
index b6bd75f534..8f89f47036 100644
--- a/clojure-ts-mode.el
+++ b/clojure-ts-mode.el
@@ -514,7 +514,14 @@ with the markdown-inline grammar."
       :feature 'doc
       :language 'markdown-inline
       :override t
-      `((code_span) @font-lock-constant-face)))
+      `([((image_description) @link)
+         ((link_destination) @font-lock-constant-face)
+         ((code_span) @font-lock-constant-face)
+         ((emphasis) @underline)
+         ((strong_emphasis) @bold)
+         (inline_link (link_text) @link)
+         (inline_link (link_destination) @font-lock-constant-face)
+         (shortcut_link (link_text) @link)])))
 
    (treesit-font-lock-rules
     :feature 'quote
diff --git a/test/samples/docstrings.clj b/test/samples/docstrings.clj
index c3bb2a773b..e8d5821254 100644
--- a/test/samples/docstrings.clj
+++ b/test/samples/docstrings.clj
@@ -42,7 +42,16 @@ Don't format code this way."
     "fizz"))
 
 (defmacro fix-bug
-  "Fixes most known bugs."
+  "Fixes most known bugs.
+
+  Check markdown:
+  - [[some-function]]
+  - _emphasize_
+  - [link](https://github.com)
+  - __strong__
+  - *emphasize*
+
+  Looks good."
   [& body]
   `(try
      ~@body

Reply via email to