@@ -345,6 +345,7 @@ if a third argument (the value) is provided.
345345 (treesit-range-rules
346346 :embed 'markdown-inline
347347 :host 'clojure
348+ :local t
348349 (clojure-ts--docstring-query '@capture )))
349350
350351(defun clojure-ts--font-lock-settings (markdown-available )
@@ -1230,7 +1231,7 @@ It is simply `clojure-ts-docstring-fill-prefix-width' number of spaces."
12301231(defun clojure-ts--fill-paragraph (&optional justify )
12311232 " Like `fill-paragraph' , but can handler Clojure docstrings.
12321233If JUSTIFY is non-nil, justify as well as fill the paragraph."
1233- (let ((current-node (treesit-node-at (point ))))
1234+ (let ((current-node (treesit-node-at (point ) 'clojure )))
12341235 (if (clojure-ts--match-docstring nil current-node nil )
12351236 (let ((fill-column (or clojure-ts-docstring-fill-column fill-column))
12361237 (fill-prefix (clojure-ts--docstring-fill-prefix))
@@ -1260,11 +1261,20 @@ If JUSTIFY is non-nil, justify as well as fill the paragraph."
12601261 " map_lit" " ns_map_lit" " vec_lit" " set_lit" )
12611262 " A regular expression that matches nodes that can be treated as lists." )
12621263
1264+ (defconst clojure-ts--markdown-inline-sexp-nodes
1265+ '(" inline_link" " full_reference_link" " collapsed_reference_link"
1266+ " uri_autolink" " email_autolink" " shortcut_link" " image"
1267+ " code_span" )
1268+ " Nodes representing s-expressions in the `markdown-inline' parser." )
1269+
12631270(defconst clojure-ts--thing-settings
12641271 `((clojure
12651272 (sexp ,(regexp-opt clojure-ts--sexp-nodes))
12661273 (list ,(regexp-opt clojure-ts--list-nodes))
1267- (text ,(regexp-opt '(" comment" ))))))
1274+ (text ,(regexp-opt '(" comment" ))))
1275+ (when clojure-ts-use-markdown-inline
1276+ (markdown-inline
1277+ (sexp ,(regexp-opt clojure-ts--markdown-inline-sexp-nodes))))))
12681278
12691279(defvar clojure-ts-mode-map
12701280 (let ((map (make-sparse-keymap )))
@@ -1380,7 +1390,6 @@ See `clojure-ts--font-lock-settings' for usage of MARKDOWN-AVAILABLE."
13801390 (let ((use-markdown-inline (and clojure-ts-use-markdown-inline
13811391 (treesit-ready-p 'markdown-inline t ))))
13821392 (when use-markdown-inline
1383- (treesit-parser-create 'markdown-inline )
13841393 (setq-local treesit-range-settings clojure-ts--treesit-range-settings))
13851394
13861395 (when (treesit-ready-p 'clojure )
0 commit comments