Skip to content

Commit 562aa91

Browse files
committed
fix link highlighting and image link highlighting
1 parent ecab949 commit 562aa91

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

syntax/scdoc.vim

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,14 @@ syn region scdocEmphasis matchgroup=scdocSimpleTag start=/\<emphasis::/ skip=/\\
7676
syn region scdocSoft matchgroup=scdocSimpleTag start=/\<soft::/ skip=/\\::/ end=/::/
7777

7878
" only highlight the first part of the link. order is important here
79-
syn region scdocRealLink keepend start=/\(\<link::\)\@<=/ end=/::/he=s-1 contained
80-
syn region scdocRealLink keepend start=/\(\<link::\)\@<=/ end=/#/he=s-1 contained
81-
syn region scdocRealLink keepend start=/\(\<link::[^#]*#\)\@<=/ end=/::/he=s-1 contained
82-
syn region scdocRealLink keepend start=/\(\<link::[^#]*#\)\@<=/ end=/#/he=s-1 contained
79+
syn region scdocRealLink keepend start=// end=/::/he=s-1 contained
80+
syn region scdocRealLink keepend start=// end=/#/he=s-1 contained
81+
syn region scdocRealLink keepend start=/\(\<::[^#]*#\)\@<=/ end=/::/he=s-1 contained
82+
syn region scdocRealLink keepend start=/\(\<::[^#]*#\)\@<=/ end=/#/he=s-1 contained
8383
syn region scdocLink keepend matchgroup=scdocSimpleTag start=/\<link::/ skip=/\\::/ end=/::/ contains=scdocRealLink
8484

8585
syn region scdocAnchor matchgroup=scdocSimpleTag start=/\<anchor::/ skip=/\\::/ end=/::/
86-
syn region scdocImage matchgroup=scdocSimpleTag start=/\<image::/ skip=/\\::/ end=/::/
86+
syn region scdocImage keepend matchgroup=scdocSimpleTag start=/\<image::/ skip=/\\::/ end=/::/ contains=scdocRealLink
8787

8888

8989
" teletype and code have inline and block forms
@@ -188,9 +188,8 @@ hi scdocStrong cterm=bold
188188
hi scdocEmphasis cterm=italic
189189
hi def link scdocSoft Comment
190190
hi def link scdocRealLink Underlined
191-
" don't link scdocLink
191+
" don't link scdocLink or scdocImage
192192
hi def link scdocAnchor Underlined
193-
hi def link scdocImage Underlined
194193
hi def link scdocTeletype Statement
195194

196195
hi def link scdocNote String

0 commit comments

Comments
 (0)