I am attaching here the related new patch, which is also available in the merge request added at https://salsa.debian.org/vim-team/vim/-/merge_requests/5.
Best, -Marco
From: Marco Villegas <ma...@marvil07.net> Date: Mon, 13 Sep 2021 12:42:32 -0500 Subject: Mitigate markdown syntax link performance issue Adapted from K.Takata suggestion at https://github.com/vim/vim/issues/6777#issuecomment-684776825 Upstream issue at https://github.com/vim/vim/issues/6777 Related issue https://github.com/vim/vim/issues/2049 Closes: #994209 Signed-off-by: Marco Villegas <ma...@marvil07.net> --- runtime/syntax/markdown.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/syntax/markdown.vim b/runtime/syntax/markdown.vim index 17b61c2..860cfe5 100644 --- a/runtime/syntax/markdown.vim +++ b/runtime/syntax/markdown.vim @@ -79,7 +79,7 @@ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+ syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained -syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\%(\_[^][]\|\[\_[^][]*\]\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart +syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^][]*\%(\[\_[^][]*\]\_[^][]*\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline