From cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74 Mon Sep 17 00:00:00 2001 From: Ben Weedon Date: Tue, 9 Aug 2022 22:24:13 -0700 Subject: Conceal reference and shortcut links in markdown This change conceals `full_reference_link`, `collapsed_reference_link`, and `shortcut_link` similarly to the `markdown_inline` query file already conceals `inline_link` and `image`. ## Test markdown contents ```markdown Some text before the link [full reference link text][link label] and now some text after the link onto a new line. Some text before the link [collapsed reference link text][] and now some text after the link onto a new line. Some text before the link [shortcut link text] and now some text after the link onto a new line. ``` ## Test markdown concealed screenshot Closes #3267 --- queries/markdown_inline/highlights.scm | 36 ++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/queries/markdown_inline/highlights.scm b/queries/markdown_inline/highlights.scm index 495e6f1a..cb50656f 100644 --- a/queries/markdown_inline/highlights.scm +++ b/queries/markdown_inline/highlights.scm @@ -48,11 +48,10 @@ "[" "]" "(" - (link_destination) + (link_destination) ")" -] @conceal -(#set! conceal "")) - + ] @conceal + (#set! conceal "")) ; Conceal image links (image @@ -61,7 +60,32 @@ "[" "]" "(" - (link_destination) + (link_destination) ")" -] @conceal + ] @conceal + (#set! conceal "")) + +; Conceal full reference links +(full_reference_link + [ + "[" + "]" + (link_label) + ] @conceal + (#set! conceal "")) + +; Conceal collapsed reference links +(collapsed_reference_link + [ + "[" + "]" + ] @conceal + (#set! conceal "")) + +; Conceal shortcut links +(shortcut_link + [ + "[" + "]" + ] @conceal (#set! conceal "")) -- cgit v1.2.3