annotate runtime/syntax/markdown.vim @ 31831:554bd03ff609 v9.0.1248

patch 9.0.1248: cannot export an interface Commit: https://github.com/vim/vim/commit/53f54e49b7152e93d09ff77406f7eb63b3b5f732 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jan 26 20:36:56 2023 +0000 patch 9.0.1248: cannot export an interface Problem: Cannot export an interface. (Ernie Rael) Solution: Add the EX_EXPORT flag to :interface. (closes https://github.com/vim/vim/issues/11884)
author Bram Moolenaar <Bram@vim.org>
date Thu, 26 Jan 2023 21:45:03 +0100
parents 3295247d97a5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
1 " Vim syntax file
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
2 " Language: Markdown
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
3 " Maintainer: Tim Pope <https://github.com/tpope/vim-markdown>
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
4 " Filenames: *.markdown
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
5 " Last Change: 2022 Oct 13
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
6
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
7 if exists("b:current_syntax")
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
8 finish
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
9 endif
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
10
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
11 if !exists('main_syntax')
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
12 let main_syntax = 'markdown'
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
13 endif
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
14
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
15 if has('folding')
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
16 let s:foldmethod = &l:foldmethod
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
17 let s:foldtext = &l:foldtext
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
18 endif
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
19 let s:iskeyword = &l:iskeyword
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
20
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
21 runtime! syntax/html.vim
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
22 unlet! b:current_syntax
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
23
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
24 if !exists('g:markdown_fenced_languages')
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
25 let g:markdown_fenced_languages = []
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
26 endif
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
27 let s:done_include = {}
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
28 for s:type in map(copy(g:markdown_fenced_languages),'matchstr(v:val,"[^=]*$")')
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
29 if has_key(s:done_include, matchstr(s:type,'[^.]*'))
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
30 continue
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
31 endif
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
32 if s:type =~ '\.'
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
33 let b:{matchstr(s:type,'[^.]*')}_subtype = matchstr(s:type,'\.\zs.*')
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
34 endif
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
35 syn case match
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
36 exe 'syn include @markdownHighlight_'.tr(s:type,'.','_').' syntax/'.matchstr(s:type,'[^.]*').'.vim'
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
37 unlet! b:current_syntax
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
38 let s:done_include[matchstr(s:type,'[^.]*')] = 1
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
39 endfor
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
40 unlet! s:type
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
41 unlet! s:done_include
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
42
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
43 syn spell toplevel
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
44 if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
45 let &l:foldmethod = s:foldmethod
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
46 unlet s:foldmethod
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
47 endif
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
48 if exists('s:foldtext') && s:foldtext !=# &l:foldtext
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
49 let &l:foldtext = s:foldtext
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
50 unlet s:foldtext
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
51 endif
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
52 if s:iskeyword !=# &l:iskeyword
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
53 let &l:iskeyword = s:iskeyword
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
54 endif
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
55 unlet s:iskeyword
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
56
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
57 if !exists('g:markdown_minlines')
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
58 let g:markdown_minlines = 50
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
59 endif
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
60 execute 'syn sync minlines=' . g:markdown_minlines
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
61 syn sync linebreaks=1
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
62 syn case ignore
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
63
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
64 syn match markdownValid '[<>]\c[a-z/$!]\@!' transparent contains=NONE
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
65 syn match markdownValid '&\%(#\=\w*;\)\@!' transparent contains=NONE
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
66
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
67 syn match markdownLineStart "^[<@]\@!" nextgroup=@markdownBlock,htmlSpecialChar
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
68
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
69 syn cluster markdownBlock contains=markdownH1,markdownH2,markdownH3,markdownH4,markdownH5,markdownH6,markdownBlockquote,markdownListMarker,markdownOrderedListMarker,markdownCodeBlock,markdownRule
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
70 syn cluster markdownInline contains=markdownLineBreak,markdownLinkText,markdownItalic,markdownBold,markdownCode,markdownEscape,@htmlTop,markdownError,markdownValid
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
71
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
72 syn match markdownH1 "^.\+\n=\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
73 syn match markdownH2 "^.\+\n-\+$" contained contains=@markdownInline,markdownHeadingRule,markdownAutomaticLink
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
74
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
75 syn match markdownHeadingRule "^[=-]\+$" contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
76
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
77 syn region markdownH1 matchgroup=markdownH1Delimiter start=" \{,3}#\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
78 syn region markdownH2 matchgroup=markdownH2Delimiter start=" \{,3}##\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
79 syn region markdownH3 matchgroup=markdownH3Delimiter start=" \{,3}###\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
80 syn region markdownH4 matchgroup=markdownH4Delimiter start=" \{,3}####\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
81 syn region markdownH5 matchgroup=markdownH5Delimiter start=" \{,3}#####\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
82 syn region markdownH6 matchgroup=markdownH6Delimiter start=" \{,3}######\s" end="#*\s*$" keepend oneline contains=@markdownInline,markdownAutomaticLink contained
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
83
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
84 syn match markdownBlockquote ">\%(\s\|$\)" contained nextgroup=@markdownBlock
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
85
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
86 syn region markdownCodeBlock start="^\n\( \{4,}\|\t\)" end="^\ze \{,3}\S.*$" keepend
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
87
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
88 " TODO: real nesting
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
89 syn match markdownListMarker "\%(\t\| \{0,4\}\)[-*+]\%(\s\+\S\)\@=" contained
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
90 syn match markdownOrderedListMarker "\%(\t\| \{0,4}\)\<\d\+\.\%(\s\+\S\)\@=" contained
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
91
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
92 syn match markdownRule "\* *\* *\*[ *]*$" contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
93 syn match markdownRule "- *- *-[ -]*$" contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
94
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
95 syn match markdownLineBreak " \{2,\}$"
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
96
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
97 syn region markdownIdDeclaration matchgroup=markdownLinkDelimiter start="^ \{0,3\}!\=\[" end="\]:" oneline keepend nextgroup=markdownUrl skipwhite
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
98 syn match markdownUrl "\S\+" nextgroup=markdownUrlTitle skipwhite contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
99 syn region markdownUrl matchgroup=markdownUrlDelimiter start="<" end=">" oneline keepend nextgroup=markdownUrlTitle skipwhite contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
100 syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+"+ end=+"+ keepend contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
101 syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+'+ end=+'+ keepend contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
102 syn region markdownUrlTitle matchgroup=markdownUrlTitleDelimiter start=+(+ end=+)+ keepend contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
103
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
104 syn region markdownLinkText matchgroup=markdownLinkTextDelimiter start="!\=\[\%(\_[^][]*\%(\[\_[^][]*\]\_[^][]*\)*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" nextgroup=markdownLink,markdownId skipwhite contains=@markdownInline,markdownLineStart
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
105 syn region markdownLink matchgroup=markdownLinkDelimiter start="(" end=")" contains=markdownUrl keepend contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
106 syn region markdownId matchgroup=markdownIdDelimiter start="\[" end="\]" keepend contained
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
107 syn region markdownAutomaticLink matchgroup=markdownUrlDelimiter start="<\%(\w\+:\|[[:alnum:]_+-]\+@\)\@=" end=">" keepend oneline
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
108
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
109 let s:concealends = ''
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
110 if has('conceal') && get(g:, 'markdown_syntax_conceal', 1) == 1
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
111 let s:concealends = ' concealends'
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
112 endif
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
113 exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\*\S\@=" end="\S\@<=\*\|^$" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
114 exe 'syn region markdownItalic matchgroup=markdownItalicDelimiter start="\w\@<!_\S\@=" end="\S\@<=_\w\@!\|^$" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
115 exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\*\*\S\@=" end="\S\@<=\*\*\|^$" skip="\\\*" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
116 exe 'syn region markdownBold matchgroup=markdownBoldDelimiter start="\w\@<!__\S\@=" end="\S\@<=__\w\@!\|^$" skip="\\_" contains=markdownLineStart,markdownItalic,@Spell' . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
117 exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\*\*\*\S\@=" end="\S\@<=\*\*\*\|^$" skip="\\\*" contains=markdownLineStart,@Spell' . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
118 exe 'syn region markdownBoldItalic matchgroup=markdownBoldItalicDelimiter start="\w\@<!___\S\@=" end="\S\@<=___\w\@!\|^$" skip="\\_" contains=markdownLineStart,@Spell' . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
119 exe 'syn region markdownStrike matchgroup=markdownStrikeDelimiter start="\~\~\S\@=" end="\S\@<=\~\~\|^$" contains=markdownLineStart,@Spell' . s:concealends
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
120
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
121 syn region markdownCode matchgroup=markdownCodeDelimiter start="`" end="`" keepend contains=markdownLineStart
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
122 syn region markdownCode matchgroup=markdownCodeDelimiter start="`` \=" end=" \=``" keepend contains=markdownLineStart
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
123 syn region markdownCodeBlock matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\).*$" end="^\s*\z1\ze\s*$" keepend
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
124 syn region markdownCodeBlock matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\).*$" end="^\s*\z1\ze\s*$" keepend
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
125
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
126 syn match markdownFootnote "\[^[^\]]\+\]"
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
127 syn match markdownFootnoteDefinition "^\[^[^\]]\+\]:"
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
128
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
129 let s:done_include = {}
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
130 for s:type in g:markdown_fenced_languages
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
131 if has_key(s:done_include, matchstr(s:type,'[^.]*'))
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
132 continue
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
133 endif
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
134 exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
135 exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
136 let s:done_include[matchstr(s:type,'[^.]*')] = 1
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
137 endfor
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
138 unlet! s:type
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
139 unlet! s:done_include
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
140
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
141 if get(b:, 'markdown_yaml_head', get(g:, 'markdown_yaml_head', main_syntax ==# 'markdown'))
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
142 syn include @markdownYamlTop syntax/yaml.vim
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
143 unlet! b:current_syntax
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
144 syn region markdownYamlHead start="\%^---$" end="^\%(---\|\.\.\.\)\s*$" keepend contains=@markdownYamlTop,@Spell
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
145 endif
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
146
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
147 syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
148 syn match markdownError "\w\@<=_\w\@="
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
149
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
150 hi def link markdownH1 htmlH1
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
151 hi def link markdownH2 htmlH2
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
152 hi def link markdownH3 htmlH3
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
153 hi def link markdownH4 htmlH4
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
154 hi def link markdownH5 htmlH5
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
155 hi def link markdownH6 htmlH6
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
156 hi def link markdownHeadingRule markdownRule
18818
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
157 hi def link markdownH1Delimiter markdownHeadingDelimiter
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
158 hi def link markdownH2Delimiter markdownHeadingDelimiter
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
159 hi def link markdownH3Delimiter markdownHeadingDelimiter
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
160 hi def link markdownH4Delimiter markdownHeadingDelimiter
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
161 hi def link markdownH5Delimiter markdownHeadingDelimiter
5c40013d45ee Update runtime files.
Bram Moolenaar <Bram@vim.org>
parents: 10048
diff changeset
162 hi def link markdownH6Delimiter markdownHeadingDelimiter
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
163 hi def link markdownHeadingDelimiter Delimiter
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
164 hi def link markdownOrderedListMarker markdownListMarker
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
165 hi def link markdownListMarker htmlTagName
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
166 hi def link markdownBlockquote Comment
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
167 hi def link markdownRule PreProc
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
168
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
169 hi def link markdownFootnote Typedef
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
170 hi def link markdownFootnoteDefinition Typedef
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
171
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
172 hi def link markdownLinkText htmlLink
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
173 hi def link markdownIdDeclaration Typedef
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
174 hi def link markdownId Type
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
175 hi def link markdownAutomaticLink markdownUrl
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
176 hi def link markdownUrl Float
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
177 hi def link markdownUrlTitle String
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
178 hi def link markdownIdDelimiter markdownLinkDelimiter
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
179 hi def link markdownUrlDelimiter htmlTag
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
180 hi def link markdownUrlTitleDelimiter Delimiter
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
181
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
182 hi def link markdownItalic htmlItalic
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
183 hi def link markdownItalicDelimiter markdownItalic
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
184 hi def link markdownBold htmlBold
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
185 hi def link markdownBoldDelimiter markdownBold
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
186 hi def link markdownBoldItalic htmlBoldItalic
10048
43efa4f5a8ea commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents: 4681
diff changeset
187 hi def link markdownBoldItalicDelimiter markdownBoldItalic
30875
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
188 hi def link markdownStrike htmlStrike
3295247d97a5 Update runtime files
Bram Moolenaar <Bram@vim.org>
parents: 19163
diff changeset
189 hi def link markdownStrikeDelimiter markdownStrike
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
190 hi def link markdownCodeDelimiter Delimiter
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
191
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
192 hi def link markdownEscape Special
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
193 hi def link markdownError Error
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
194
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
195 let b:current_syntax = "markdown"
4681
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
196 if main_syntax ==# 'markdown'
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
197 unlet main_syntax
2eb30f341e8d Updated runtime files and translations.
Bram Moolenaar <bram@vim.org>
parents: 2202
diff changeset
198 endif
2202
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
199
f7579a31705c Updated runtime files.
Bram Moolenaar <bram@vim.org>
parents:
diff changeset
200 " vim:set sw=2: