Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions autoload/vimtex/syntax/p/hyperref.vim
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ function! vimtex#syntax#p#hyperref#load(cfg) abort " {{{1

syntax match texCmdHyperref "\\url\>" nextgroup=texUrlArg skipwhite
syntax region texUrlArg matchgroup=texDelim
\ contained contains=@NoSpell,texComment
\ contained contains=@NoSpell
\ start="\z([^\ta-zA-Z]\)" end="\z1"
call vimtex#syntax#core#new_arg('texUrlArg', {'contains': 'texComment,@NoSpell'})
call vimtex#syntax#core#new_arg('texUrlArg', {'contains': '@NoSpell'})


highlight def link texCmdHyperref texCmd
Expand Down
1 change: 1 addition & 0 deletions test/test-syntax/test-hyperref.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

\url{http://www.google.com}
\url+http://www.google.com+
\url{https://www.example.com/Spaces%20In%20URL/}
\href{http://example.com}{Title text $with math$}
\urldef{\mysite}\url{http://example.com}
\hyperref[asdasd]{asd}
Expand Down
2 changes: 1 addition & 1 deletion test/test-syntax/test-hyperref.vim
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ silent edit test-hyperref.tex
if empty($INMAKE) | finish | endif

call vimtex#test#assert(vimtex#syntax#in('texUrlArg', 6, 25))
call vimtex#test#assert(vimtex#syntax#in('texRefArg', 16, 35))
call vimtex#test#assert(vimtex#syntax#in('texRefArg', 17, 35))

quit!