From b8ad0473f4d5d7b59e17a67ad0b68711b0232486 Mon Sep 17 00:00:00 2001 From: Riley Bruins Date: Fri, 20 Sep 2024 12:11:21 -0700 Subject: [PATCH] fix(markdown): broader link recognition **Problem:** Neovim's `gx` will not work when the cursor is on the first `[` of an inline Markdown link. **Solution:** Set the `url` metadata property on the link parent node, rather than just the link label node --- queries/markdown_inline/highlights.scm | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/queries/markdown_inline/highlights.scm b/queries/markdown_inline/highlights.scm index 148ef0fad..2070e9b3b 100644 --- a/queries/markdown_inline/highlights.scm +++ b/queries/markdown_inline/highlights.scm @@ -40,14 +40,12 @@ (image_description) ] @markup.link.label -(inline_link - (link_text) @_label - (link_destination) @_url +((inline_link + (link_destination) @_url) @_label (#set! @_label url @_url)) -(image - (image_description) @_label - (link_destination) @_url +((image + (link_destination) @_url) @_label (#set! @_label url @_url)) ; Conceal image links