diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ce075e..627b567 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 7a30881..b704571 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 b6bd75f..8f89f47 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 c3bb2a7..e8d5821 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