mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-17 10:50:06 -04:00
Refactor markdown conceal code
This commit is contained in:
parent
778bfc337a
commit
536f4294f6
1 changed files with 25 additions and 21 deletions
|
|
@ -81,32 +81,36 @@
|
||||||
] @conceal
|
] @conceal
|
||||||
(#set! conceal ""))
|
(#set! conceal ""))
|
||||||
|
|
||||||
(inline_link
|
|
||||||
["]"] @conceal
|
|
||||||
(#set! conceal " "))
|
|
||||||
|
|
||||||
|
;; Inline_link Conceal
|
||||||
|
; Conceal preceeding "[" character for inline links
|
||||||
(inline_link
|
(inline_link
|
||||||
"[" @conceal
|
"[" @conceal
|
||||||
(#set! conceal ""))
|
(#set! conceal ""))
|
||||||
|
|
||||||
;; Conceal @text.uri preceding '('
|
; Conceal inline links
|
||||||
([
|
(inline_link
|
||||||
(link_label)
|
[
|
||||||
(link_text)
|
"]"
|
||||||
(image_description)
|
"("
|
||||||
] ["("] @conceal
|
(link_destination)
|
||||||
(#set! conceal ""))
|
")"
|
||||||
|
|
||||||
;; Conceal @text.uri text
|
|
||||||
([
|
|
||||||
(link_destination)
|
|
||||||
(uri_autolink)
|
|
||||||
] @conceal
|
] @conceal
|
||||||
(#set! conceal ""))
|
(#set! conceal ""))
|
||||||
|
|
||||||
;; Conceal @text.uri proceding '('
|
|
||||||
([
|
;; Image Conceal
|
||||||
(link_destination)
|
; Conceal preceeding "!" and "[" characters for image links
|
||||||
(uri_autolink)
|
(image
|
||||||
] [")"] @conceal
|
["!" "["] @conceal
|
||||||
(#set! conceal ""))
|
(#set! conceal ""))
|
||||||
|
|
||||||
|
; Conceal image links
|
||||||
|
(image
|
||||||
|
[
|
||||||
|
"]"
|
||||||
|
"("
|
||||||
|
(link_destination)
|
||||||
|
")"
|
||||||
|
] @conceal
|
||||||
|
(#set! conceal ""))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue