Skip to content

Commit 87787c0

Browse files
committed
Improve markdown highlighting in the docstrings
1 parent dc66d67 commit 87787c0

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
- [#76](https://github.com/clojure-emacs/clojure-ts-mode/pull/76): Improve performance of semantic indentation by caching rules.
2222
- [#74](https://github.com/clojure-emacs/clojure-ts-mode/issues/74): Add imenu support for keywords definitions.
2323
- [#77](https://github.com/clojure-emacs/clojure-ts-mode/issues/77): Update grammars to the latest versions.
24+
- Improve markdown highlighting in the docstrings.
2425

2526
## 0.2.3 (2025-03-04)
2627

Eldev

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(setq checkdoc-permit-comma-termination-flag t)
1818
(setq checkdoc--interactive-docstring-flag nil)
1919

20-
(setf eldev-lint-default '(elisp))
20+
(setq eldev-lint-default-excluded '(package))
2121

2222
(with-eval-after-load 'elisp-lint
2323
;; We will byte-compile with Eldev.

clojure-ts-mode.el

+8-1
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,14 @@ with the markdown-inline grammar."
514514
:feature 'doc
515515
:language 'markdown-inline
516516
:override t
517-
`((code_span) @font-lock-constant-face)))
517+
`([((image_description) @link)
518+
((link_destination) @font-lock-constant-face)
519+
((code_span) @font-lock-constant-face)
520+
((emphasis) @underline)
521+
((strong_emphasis) @bold)
522+
(inline_link (link_text) @link)
523+
(inline_link (link_destination) @font-lock-constant-face)
524+
(shortcut_link (link_text) @link)])))
518525

519526
(treesit-font-lock-rules
520527
:feature 'quote

test/samples/docstrings.clj

+10-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,16 @@ Don't format code this way."
4242
"fizz"))
4343

4444
(defmacro fix-bug
45-
"Fixes most known bugs."
45+
"Fixes most known bugs.
46+
47+
Check markdown:
48+
- [[some-function]]
49+
- _emphasize_
50+
- [link](https://github.com)
51+
- __strong__
52+
- *emphasize*
53+
54+
Looks good."
4655
[& body]
4756
`(try
4857
~@body

0 commit comments

Comments
 (0)