aboutsummaryrefslogtreecommitdiffstats
path: root/queries/markdown_inline
diff options
context:
space:
mode:
authorBen Weedon <ben@weedon.email>2022-08-09 22:24:13 -0700
committerStephan Seitz <stephan.seitz@fau.de>2022-08-11 14:36:44 -0700
commitcea9c5941d5ccb9e937c2d4d49690d9c3ab09f74 (patch)
treed688893c1815becf007a87d4c664e86a57c4f180 /queries/markdown_inline
parentUpdate lockfile.json (diff)
downloadnvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.tar
nvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.tar.gz
nvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.tar.bz2
nvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.tar.lz
nvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.tar.xz
nvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.tar.zst
nvim-treesitter-cea9c5941d5ccb9e937c2d4d49690d9c3ab09f74.zip
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
Diffstat (limited to 'queries/markdown_inline')
-rw-r--r--queries/markdown_inline/highlights.scm36
1 files changed, 30 insertions, 6 deletions
diff --git a/queries/markdown_inline/highlights.scm b/queries/markdown_inline/highlights.scm
index 495e6f1ab..cb50656f1 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 ""))