|
1 |
| -scriptencoding utf-8 |
2 |
| -" vim: set fdm=marker foldlevel=0: |
3 |
| -" |
4 | 1 | " Vim syntax file
|
5 |
| -" |
6 |
| -" Language: Pandoc (superset of Markdown) |
| 2 | +" Filetype: pandoc |
| 3 | +" Language: CommonMark |
| 4 | +" Maintainer: Caleb Maclennan <caleb@alerque.com> |
7 | 5 | " Maintainer: Felipe Morales <hel.sheep@gmail.com>
|
8 |
| -" Contributor: David Sanson <dsanson@gmail.com> |
9 |
| -" Contributor: Jorge Israel Peña <jorge.israel.p@gmail.com> |
10 |
| -" OriginalAuthor: Jeremy Schultz <taozhyn@gmail.com> |
11 |
| -" Version: 5.0 |
12 |
| - |
13 |
| -" Configuration: {{{1 |
14 |
| -" |
15 |
| -" use conceal? {{{2 |
16 |
| -if !exists("g:pandoc#syntax#conceal#use") |
17 |
| - if v:version < 703 |
18 |
| - let g:pandoc#syntax#conceal#use = 0 |
19 |
| - else |
20 |
| - let g:pandoc#syntax#conceal#use = 1 |
21 |
| - endif |
22 |
| -else |
23 |
| - " exists, but we cannot use it, disable anyway |
24 |
| - if v:version < 703 |
25 |
| - let g:pandoc#syntax#conceal#use = 0 |
26 |
| - endif |
27 |
| -endif |
28 |
| -"}}}2 |
29 |
| -" what groups not to use conceal in. works as a blacklist {{{2 |
30 |
| -if !exists("g:pandoc#syntax#conceal#blacklist") |
31 |
| - let g:pandoc#syntax#conceal#blacklist = [] |
32 |
| -endif |
33 |
| -"}}}2 |
34 |
| -" cchars used in conceal rules {{{2 |
35 |
| -" utf-8 defaults (preferred) |
36 |
| -if &encoding == "utf-8" |
37 |
| - let s:cchars = { |
38 |
| - \"newline": "↵", |
39 |
| - \"image": "▨", |
40 |
| - \"super": "ⁿ", |
41 |
| - \"sub": "ₙ", |
42 |
| - \"strike": "x̶", |
43 |
| - \"atx": "§", |
44 |
| - \"codelang": "λ", |
45 |
| - \"codeend": "—", |
46 |
| - \"abbrev": "→", |
47 |
| - \"footnote": "†", |
48 |
| - \"definition": " ", |
49 |
| - \"li": "•", |
50 |
| - \"html_c_s": "‹", |
51 |
| - \"html_c_e": "›"} |
52 |
| -else |
53 |
| - " ascii defaults |
54 |
| - let s:cchars = { |
55 |
| - \"newline": " ", |
56 |
| - \"image": "i", |
57 |
| - \"super": "^", |
58 |
| - \"sub": "_", |
59 |
| - \"strike": "~", |
60 |
| - \"atx": "#", |
61 |
| - \"codelang": "l", |
62 |
| - \"codelang": "-", |
63 |
| - \"abbrev": "a", |
64 |
| - \"footnote": "f", |
65 |
| - \"definition": " ", |
66 |
| - \"li": "*", |
67 |
| - \"html_c_s": "+", |
68 |
| - \"html_c_e": "+"} |
69 |
| -endif |
70 |
| -"}}}2 |
71 |
| -" if the user has a dictionary with replacements for the default cchars, use those {{{2 |
72 |
| -if exists("g:pandoc#syntax#conceal#cchar_overrides") |
73 |
| - let s:cchars = extend(s:cchars, g:pandoc#syntax#conceal#cchar_overrides) |
74 |
| -endif |
75 |
| -"}}}2 |
76 |
| -"should the urls in links be concealed? {{{2 |
77 |
| -if !exists("g:pandoc#syntax#conceal#urls") |
78 |
| - let g:pandoc#syntax#conceal#urls = 0 |
79 |
| -endif |
80 |
| -" should backslashes in escapes be concealed? {{{2 |
81 |
| -if !exists("g:pandoc#syntax#conceal#backslash") |
82 |
| - let g:pandoc#syntax#conceal#backslash = 0 |
83 |
| -endif |
84 |
| -"}}}2 |
85 |
| -" leave specified codeblocks as Normal (i.e. 'unhighlighted') {{{2 |
86 |
| -if !exists("g:pandoc#syntax#codeblocks#ignore") |
87 |
| - let g:pandoc#syntax#codeblocks#ignore = [] |
88 |
| -endif |
89 |
| -"}}}2 |
90 |
| -" use embedded highlighting for delimited codeblocks where a language is specifed. {{{2 |
91 |
| -if !exists("g:pandoc#syntax#codeblocks#embeds#use") |
92 |
| - let g:pandoc#syntax#codeblocks#embeds#use = 1 |
93 |
| -endif |
94 |
| -"}}}2 |
95 |
| -" for what languages and using what vim syntax files highlight those embeds. {{{2 |
96 |
| -" defaults to None. |
97 |
| -if !exists("g:pandoc#syntax#codeblocks#embeds#langs") |
98 |
| - let g:pandoc#syntax#codeblocks#embeds#langs = [] |
99 |
| -endif |
100 |
| -"}}}2 |
101 |
| -" use italics ? {{{2 |
102 |
| -if !exists("g:pandoc#syntax#style#emphases") |
103 |
| - let g:pandoc#syntax#style#emphases = 1 |
104 |
| -endif |
105 |
| -" if 0, we don't conceal the emphasis marks, otherwise there wouldn't be a way |
106 |
| -" to tell where the styles apply. |
107 |
| -if g:pandoc#syntax#style#emphases == 0 |
108 |
| - call add(g:pandoc#syntax#conceal#blacklist, "block") |
109 |
| -endif |
110 |
| -" }}}2 |
111 |
| -" underline subscript, superscript and strikeout? {{{2 |
112 |
| -if !exists("g:pandoc#syntax#style#underline_special") |
113 |
| - let g:pandoc#syntax#style#underline_special = 1 |
114 |
| -endif |
115 |
| -" }}}2 |
116 |
| -" protect code blocks? {{{2 |
117 |
| -if !exists("g:pandoc#syntax#protect#codeblocks") |
118 |
| - let g:pandoc#syntax#protect#codeblocks = 1 |
119 |
| -endif |
120 |
| -" use color column? {{{2 |
121 |
| -if !exists("g:pandoc#syntax#colorcolumn") |
122 |
| - let g:pandoc#syntax#colorcolumn = 0 |
123 |
| -endif |
124 |
| -" }}}2 |
125 |
| -" highlight new lines? {{{2 |
126 |
| -if !exists("g:pandoc#syntax#newlines") |
127 |
| - let g:pandoc#syntax#newlines = 1 |
128 |
| -endif |
129 |
| -" }}} |
130 |
| -" detect roman-numeral list items? {{{2 |
131 |
| -if !exists('g:pandoc#syntax#roman_lists') |
132 |
| - let g:pandoc#syntax#roman_lists = 0 |
133 |
| -endif |
134 |
| -" }}} |
135 |
| -"}}}1 |
136 |
| - |
137 |
| -" Functions: {{{1 |
138 |
| -" EnableEmbedsforCodeblocksWithLang {{{2 |
139 |
| -function! EnableEmbedsforCodeblocksWithLang(entry) |
140 |
| - try |
141 |
| - let s:langname = matchstr(a:entry, "^[^=]*") |
142 |
| - let s:langsyntaxfile = matchstr(a:entry, "[^=]*$") |
143 |
| - unlet! b:current_syntax |
144 |
| - exe 'syn include @'.toupper(s:langname).' syntax/'.s:langsyntaxfile.'.vim' |
145 |
| - exe "syn region pandocDelimitedCodeBlock_" . s:langname . ' start=/\(\_^\(\s\{4,}\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>.*\n\)\@<=\_^/' . |
146 |
| - \' end=/\_$\n\(\(\s\{4,}\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' . |
147 |
| - \' contains=@' . toupper(s:langname) |
148 |
| - exe "syn region pandocDelimitedCodeBlockinBlockQuote_" . s:langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>/' . |
149 |
| - \ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' . |
150 |
| - \' contains=@' . toupper(s:langname) . |
151 |
| - \",pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock" |
152 |
| - catch /E484/ |
153 |
| - echo "No syntax file found for '" . s:langsyntaxfile . "'" |
154 |
| - endtry |
155 |
| -endfunction |
156 |
| -"}}}2 |
157 |
| -" DisableEmbedsforCodeblocksWithLang {{{2 |
158 |
| -function! DisableEmbedsforCodeblocksWithLang(langname) |
159 |
| - try |
160 |
| - exe 'syn clear pandocDelimitedCodeBlock_'.a:langname |
161 |
| - exe 'syn clear pandocDelimitedCodeBlockinBlockQuote_'.a:langname |
162 |
| - catch /E28/ |
163 |
| - echo "No existing highlight definitions found for '" . a:langname . "'" |
164 |
| - endtry |
165 |
| -endfunction |
166 |
| -"}}}2 |
167 |
| -" WithConceal {{{2 |
168 |
| -function! s:WithConceal(rule_group, rule, conceal_rule) |
169 |
| - let l:rule_tail = "" |
170 |
| - if g:pandoc#syntax#conceal#use != 0 |
171 |
| - if index(g:pandoc#syntax#conceal#blacklist, a:rule_group) == -1 |
172 |
| - let l:rule_tail = " " . a:conceal_rule |
173 |
| - endif |
174 |
| - endif |
175 |
| - execute a:rule . l:rule_tail |
176 |
| -endfunction |
177 |
| -"}}}2 |
178 |
| -"}}}1 |
179 |
| - |
180 |
| -" Commands: {{{1 |
181 |
| -command! -buffer -nargs=1 -complete=syntax PandocHighlight call EnableEmbedsforCodeblocksWithLang(<f-args>) |
182 |
| -command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsforCodeblocksWithLang(<f-args>) |
183 |
| -" }}} |
184 |
| - |
185 |
| -" BASE: |
186 |
| -syntax clear |
187 |
| -syntax spell toplevel |
188 |
| -" apply extra settings: {{{1 |
189 |
| -if g:pandoc#syntax#colorcolumn == 1 |
190 |
| - exe "setlocal colorcolumn=".string(&textwidth+5) |
191 |
| -elseif g:pandoc#syntax#colorcolumn == 2 |
192 |
| - exe "setlocal colorcolumn=".join(range(&textwidth+5, 2*&columns), ',') |
193 |
| -endif |
194 |
| -if g:pandoc#syntax#conceal#use != 0 |
195 |
| - setlocal conceallevel=2 |
196 |
| -endif |
197 |
| -"}}}1 |
198 |
| - |
199 |
| -" Syntax Rules: {{{1 |
200 |
| -" Embeds: {{{2 |
201 |
| -" HTML: {{{3 |
202 |
| -" Set embedded HTML highlighting |
203 |
| -syn include @HTML syntax/html.vim |
204 |
| -syn match pandocHTML /<\/\?\a.\{-}>/ contains=@HTML |
205 |
| -" Support HTML multi line comments |
206 |
| -syn region pandocHTMLComment start=/<!--\s\=/ end=/\s\=-->/ keepend contains=pandocHTMLCommentStart,pandocHTMLCommentEnd |
207 |
| -call s:WithConceal('html_c_s', 'syn match pandocHTMLCommentStart /<!--/ contained', 'conceal cchar='.s:cchars['html_c_s']) |
208 |
| -call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained', 'conceal cchar='.s:cchars['html_c_e']) |
209 |
| -" }}} |
210 |
| -" LaTeX: {{{3 |
211 |
| -" Set embedded LaTex (pandoc extension) highlighting |
212 |
| -" Unset current_syntax so the 2nd include will work |
213 |
| -unlet b:current_syntax |
214 |
| -syn include @LATEX syntax/tex.vim |
215 |
| -syn region pandocLaTeXInlineMath start=/\\\@<!\$[[:graph:]]\@=/ end=/\\\@<!\$/ keepend contains=@LATEX |
216 |
| -syn region pandocLaTeXInlineMath start=/\\\@<!\\([[:graph:]]\@=/ end=/\\\@<!\\)/ keepend contains=@LATEX |
217 |
| -syn match pandocProtectedFromInlineLaTeX /\\\@<!\${.*}\(\(\s\|[[:punct:]]\)\([^$]*\|.*\(\\\$.*\)\{2}\)\n\n\|$\)\@=/ display |
218 |
| -" contains=@LATEX |
219 |
| -syn region pandocLaTeXMathBlock start=/\$\$/ end=/\$\$/ keepend contains=@LATEX |
220 |
| -syn match pandocLaTeXCommand /\\[[:alpha:]]\+\(\({.\{-}}\)\=\(\[.\{-}\]\)\=\)*/ contains=@LATEX |
221 |
| -syn region pandocLaTeXRegion start=/\\begin{\z(.\{-}\)}/ end=/\\end{\z1}/ keepend contains=@LATEX |
222 |
| -" we rehighlight sectioning commands, because otherwise tex.vim captures all text until EOF or a new sectioning command |
223 |
| -syn region pandocLaTexSection start=/\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)\*\=\(\[.*\]\)\={/ end=/\}/ keepend |
224 |
| -syn match pandocLaTexSectionCmd /\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)/ contained containedin=pandocLaTexSection |
225 |
| -syn match pandocLaTeXDelimiter /[[\]{}]/ contained containedin=pandocLaTexSection |
226 |
| -" }}}} |
227 |
| -" }}}2 |
228 |
| -" Titleblock: {{{2 |
229 |
| -" |
230 |
| -syn region pandocTitleBlock start=/\%^%/ end=/\n\n/ contains=pandocReferenceLabel,pandocReferenceURL,pandocNewLine |
231 |
| -call s:WithConceal("titleblock", 'syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle', 'conceal') |
232 |
| -syn match pandocTitleBlockTitle /\%^%.*\n/ contained containedin=pandocTitleBlock |
233 |
| -"}}} |
234 |
| -" Blockquotes: {{{2 |
235 |
| -" |
236 |
| -syn match pandocBlockQuote /^\s\{,3}>.*\n\(.*\n\@1<!\n\)*/ contains=@Spell,pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted skipnl |
237 |
| -syn match pandocBlockQuoteMark /\_^\s\{,3}>/ contained containedin=pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted |
238 |
| - |
239 |
| -" }}} |
240 |
| -" Code Blocks: {{{2 |
241 |
| -if g:pandoc#syntax#protect#codeblocks == 1 |
242 |
| - syn match pandocCodeblock /\s\{4}.*$/ |
243 |
| -endif |
244 |
| -syn region pandocCodeBlockInsideIndent start=/\(\(\d\|\a\|*\).*\n\)\@<!\(^\(\s\{8,}\|\t\+\)\).*\n/ end=/.\(\n^\s*\n\)\@=/ contained |
245 |
| -"}}} |
246 |
| -" Links: {{{2 |
247 |
| -" |
248 |
| -" Base: {{{3 |
249 |
| -syn region pandocReferenceLabel matchgroup=Operator start=/!\{,1}\\\@<!\[/ skip=/\(\\\@<!\]\]\@=\|`.*\\\@<!].*`\)/ end=/\\\@<!\]/ keepend display |
250 |
| -if g:pandoc#syntax#conceal#urls == 1 |
251 |
| - syn region pandocReferenceURL matchgroup=Operator start=/\]\@1<=(/ end=/)/ keepend display conceal |
252 |
| -else |
253 |
| - syn region pandocReferenceURL matchgroup=Operator start=/\]\@1<=(/ end=/)/ keepend display |
254 |
| -endif |
255 |
| -" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links |
256 |
| -syn match pandocNoLabel /\]\@1<!\(\s\{,3}\|^\)\[[^\[\]]\{-}\]\(\s\+\|$\)[\[(]\@!/ contains=pandocPCite |
257 |
| -syn match pandocLinkTip /\s*".\{-}"/ contained containedin=pandocReferenceURL contains=@Spell display |
258 |
| -call s:WithConceal("image", 'syn match pandocImageIcon /!\[\@=/ display', 'conceal cchar='. s:cchars["image"]) |
259 |
| -" }}} |
260 |
| -" Definitions: {{{3 |
261 |
| -syn region pandocReferenceDefinition start=/\[.\{-}\]:/ end=/\(\n\s*".*"$\|$\)/ keepend |
262 |
| -syn match pandocReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=pandocReferenceDefinition display |
263 |
| -syn match pandocReferenceDefinitionAddress /:\s*\zs.*/ contained containedin=pandocReferenceDefinition |
264 |
| -syn match pandocReferenceDefinitionTip /\s*".\{-}"/ contained containedin=pandocReferenceDefinition,pandocReferenceDefinitionAddress contains=@Spell |
265 |
| -"}}} |
266 |
| -" Automatic_links: {{{3 |
267 |
| -syn match pandocAutomaticLink /<\(https\{0,1}.\{-}\|.\{-}@.\{-}\..\{-}\)>/ contains=NONE |
268 |
| -" }}} |
269 |
| -"}}} |
270 |
| -" Citations: {{{2 |
271 |
| -" parenthetical citations |
272 |
| -syn match pandocPCite /\[.\{-}-\{0,1}@.\{-}\]/ contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell display |
273 |
| -" in-text citations with location |
274 |
| -syn match pandocICite /@[[:graph:]äëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß]*\s\[.\{-}\]/ contains=pandocCiteKey,@Spell display |
275 |
| -" cite keys |
276 |
| -syn match pandocCiteKey /\(-\=@[[:graph:]äëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß]*\)\(\]\|\>\)\@=/ containedin=pandocPCite,pandocICite contains=@NoSpell display |
277 |
| -syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display |
278 |
| -syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite |
279 |
| -" }}} |
280 |
| -" Text Styles: {{{2 |
281 |
| - |
282 |
| -" Emphasis: {{{3 |
283 |
| -" |
284 |
| -call s:WithConceal("block", 'syn region pandocEmphasis matchgroup=Operator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath', 'concealends') |
285 |
| -call s:WithConceal("block", 'syn region pandocEmphasis matchgroup=Operator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath', 'concealends') |
286 |
| -" }}} |
287 |
| -" Strong: {{{3 |
288 |
| -" |
289 |
| -call s:WithConceal("block", 'syn region pandocStrong matchgroup=Operator start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath', 'concealends') |
290 |
| -call s:WithConceal("block", 'syn region pandocStrong matchgroup=Operator start=/__/ end=/__/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath', 'concealends') |
291 |
| -"}}} |
292 |
| -" Strong Emphasis: {{{3 |
293 |
| -" |
294 |
| -call s:WithConceal("block", 'syn region pandocStrongEmphasis matchgroup=Operator start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell', 'concealends') |
295 |
| -call s:WithConceal("block", 'syn region pandocStrongEmphasis matchgroup=Operator start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell', 'concealends') |
296 |
| -" }}} |
297 |
| -" Mixed: {{{3 |
298 |
| -call s:WithConceal("block", 'syn region pandocStrongInEmphasis matchgroup=Operator start=/\*\*/ end=/\*\*/ contained containedin=pandocEmphasis contains=@Spell', 'concealends') |
299 |
| -call s:WithConceal("block", 'syn region pandocStrongInEmphasis matchgroup=Operator start=/__/ end=/__/ contained containedin=pandocEmphasis contains=@Spell', 'concealends') |
300 |
| -call s:WithConceal("block", 'syn region pandocEmphasisInStrong matchgroup=Operator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell', 'concealends') |
301 |
| -call s:WithConceal("block", 'syn region pandocEmphasisInStrong matchgroup=Operator start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell', 'concealends') |
302 |
| - |
303 |
| -" Inline Code: {{{3 |
304 |
| - |
305 |
| -" Using single back ticks |
306 |
| -call s:WithConceal("inlinecode", 'syn region pandocNoFormatted matchgroup=Operator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs', 'concealends') |
307 |
| -call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInEmphasis matchgroup=Operator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') |
308 |
| -call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInStrong matchgroup=Operator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') |
309 |
| -" Using double back ticks |
310 |
| -call s:WithConceal("inlinecode", 'syn region pandocNoFormatted matchgroup=Operator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs', 'concealends') |
311 |
| -call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInEmphasis matchgroup=Operator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') |
312 |
| -call s:WithConceal("inlinecode", 'syn region pandocNoFormattedInStrong matchgroup=Operator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends') |
313 |
| -syn match pandocNoFormattedAttrs /{.\{-}}/ contained |
314 |
| -"}}} |
315 |
| -" Subscripts: {{{3 |
316 |
| -syn region pandocSubscript start=/\~\(\([[:graph:]]\(\\ \)\=\)\{-}\~\)\@=/ end=/\~/ keepend |
317 |
| -call s:WithConceal("subscript", 'syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript', 'conceal cchar='.s:cchars["sub"]) |
318 |
| -"}}} |
319 |
| -" Superscript: {{{3 |
320 |
| -syn region pandocSuperscript start=/\^\(\([[:graph:]]\(\\ \)\=\)\{-}\^\)\@=/ skip=/\\ / end=/\^/ keepend |
321 |
| -call s:WithConceal("superscript", 'syn match pandocSuperscriptMark /\^/ contained containedin=pandocSuperscript', 'conceal cchar='.s:cchars["super"]) |
322 |
| -"}}} |
323 |
| -" Strikeout: {{{3 |
324 |
| -syn region pandocStrikeout start=/\~\~/ end=/\~\~/ contains=@Spell keepend |
325 |
| -call s:WithConceal("strikeout", 'syn match pandocStrikeoutMark /\~\~/ contained containedin=pandocStrikeout', 'conceal cchar='.s:cchars["strike"]) |
326 |
| -" }}} |
327 |
| -" }}} |
328 |
| -" Headers: {{{2 |
329 |
| -" |
330 |
| -syn match pandocAtxHeader /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,@Spell, display |
331 |
| -syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@<!#\+\(\s*.*$\)\@=\)/ contained containedin=pandocAtxHeader |
332 |
| -call s:WithConceal("atx", 'syn match pandocAtxStart /#/ contained containedin=pandocAtxHeaderMark', 'conceal cchar='.s:cchars["atx"]) |
333 |
| -syn match pandocSetexHeader /^.\+\n[=]\+$/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,@Spell |
334 |
| -syn match pandocSetexHeader /^.\+\n[-]\+$/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,@Spell |
335 |
| -syn match pandocHeaderAttr /{.*}/ contained containedin=pandocAtxHeader,pandocSetexHeader |
336 |
| -syn match pandocHeaderID /#[-_:.[:alpha:]]*/ contained containedin=pandocHeaderAttr |
337 |
| -"}}} |
338 |
| -" Line Blocks: {{{2 |
339 |
| -syn region pandocLineBlock start=/^|/ end=/\(^|\(.*\n|\@!\)\@=.*\)\@<=\n/ transparent |
340 |
| -syn match pandocLineBlockDelimiter /^|/ contained containedin=pandocLineBlock |
341 |
| -"}}} |
342 |
| -" Tables: {{{2 |
343 |
| - |
344 |
| -" Simple: {{{3 |
345 |
| - |
346 |
| -syn region pandocSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\+\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend |
347 |
| -syn match pandocSimpleTableDelims /\-/ contained containedin=pandocSimpleTable |
348 |
| -syn match pandocSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=pandocSimpleTable |
349 | 6 |
|
350 |
| -syn region pandocTable start=/\%#=2^\(-\+\s*\)\+\n\n\@!/ end=/\%#=2^\(-\+\s*\)\+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend |
351 |
| -syn match pandocTableDelims /\-/ contained containedin=pandocTable |
352 |
| -syn region pandocTableMultilineHeader start=/\%#=2\(^-\+\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=pandocTable |
353 |
| - |
354 |
| -" }}}3 |
355 |
| -" Grid: {{{3 |
356 |
| -syn region pandocGridTable start=/\%#=2\n\@1<=+-/ end=/+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend |
357 |
| -syn match pandocGridTableDelims /[\|=]/ contained containedin=pandocGridTable |
358 |
| -syn match pandocGridTableDelims /\%#=2\([\-+][\-+=]\@=\|[\-+=]\@1<=[\-+]\)/ contained containedin=pandocGridTable |
359 |
| -syn match pandocGridTableHeader /\%#=2\(^.*\n\)\(+=.*\)\@=/ contained containedin=pandocGridTable |
360 |
| -"}}}3 |
361 |
| -" Pipe: {{{3 |
362 |
| -" with beginning and end pipes |
363 |
| -syn region pandocPipeTable start=/\%#=2\([+|]\n\)\@<!\n\@1<=|\(.*|\)\@=/ end=/|.*\n\(\n\|{\)/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend |
364 |
| -" without beginning and end pipes |
365 |
| -syn region pandocPipeTable start=/\%#=2^.*\n-.\{-}|/ end=/|.*\n\n/ keepend |
366 |
| -syn match pandocPipeTableDelims /[\|\-:+]/ contained containedin=pandocPipeTable |
367 |
| -syn match pandocPipeTableHeader /\(^.*\n\)\(|-\)\@=/ contained containedin=pandocPipeTable |
368 |
| -syn match pandocPipeTableHeader /\(^.*\n\)\(-\)\@=/ contained containedin=pandocPipeTable |
369 |
| -" }}}3 |
370 |
| -syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTableHeader,pandocPipeTableHeader |
371 |
| -" }}}2 |
372 |
| -" Delimited Code Blocks: {{{2 |
373 |
| -" this is here because we can override strikeouts and subscripts |
374 |
| -syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\(\s\{4,}\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend |
375 |
| -syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\(\s\{4,}\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend |
376 |
| -call s:WithConceal("codeblock_start", 'syn match pandocDelimitedCodeBlockStart /\(\_^\n\_^\(>\s\)\?\(\s\{4,}\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars["codelang"]) |
377 |
| -syn match pandocDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained |
378 |
| -call s:WithConceal("codeblock_delim", 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock', 'conceal cchar='.s:cchars["codeend"]) |
379 |
| -syn match pandocBlockQuoteinDelimitedCodeBlock '^>' contained containedin=pandocDelimitedCodeBlock |
380 |
| -syn match pandocCodePre /<pre>.\{-}<\/pre>/ skipnl |
381 |
| -syn match pandocCodePre /<code>.\{-}<\/code>/ skipnl |
382 |
| - |
383 |
| -" enable highlighting for embedded region in codeblocks if there exists a |
384 |
| -" g:pandoc#syntax#codeblocks#embeds#langs *list*. |
385 |
| -" |
386 |
| -" entries in this list are the language code interpreted by pandoc, |
387 |
| -" if this differs from the name of the vim syntax file, append =vimname |
388 |
| -" e.g. let g:pandoc#syntax#codeblocks#embeds#langs = ["haskell", "literatehaskell=lhaskell"] |
389 |
| -" |
390 |
| -if g:pandoc#syntax#codeblocks#embeds#use != 0 |
391 |
| - for l in g:pandoc#syntax#codeblocks#embeds#langs |
392 |
| - call EnableEmbedsforCodeblocksWithLang(l) |
393 |
| - endfor |
394 |
| -endif |
395 |
| -" }}} |
396 |
| -" Abbreviations: {{{2 |
397 |
| -syn region pandocAbbreviationDefinition start=/^\*\[.\{-}\]:\s*/ end="$" contains=pandocNoFormatted,@Spell |
398 |
| -call s:WithConceal('abbrev', 'syn match pandocAbbreviationSeparator /:/ contained containedin=pandocAbbreviationDefinition', "conceal cchar=".s:cchars["abbrev"]) |
399 |
| -syn match pandocAbbreviation /\*\[.\{-}\]/ contained containedin=pandocAbbreviationDefinition |
400 |
| -call s:WithConceal('abbrev', 'syn match pandocAbbreviationHead /\*\[/ contained containedin=pandocAbbreviation', "conceal") |
401 |
| -call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained containedin=pandocAbbreviation', "conceal") |
402 |
| -" }}} |
403 |
| -" Footnotes: {{{2 |
404 |
| -" we put these here not to interfere with superscripts. |
405 |
| -" |
406 |
| -syn match pandocFootnoteID /\[\^[^\]]\+\]/ nextgroup=pandocFootnoteDef |
407 |
| -" Inline footnotes |
408 |
| -syn region pandocFootnoteDef start=/\^\[/ end=/\]/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell skipnl keepend |
409 |
| -call s:WithConceal("footnote", 'syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef', 'conceal cchar='.s:cchars["footnote"]) |
410 |
| -call s:WithConceal("footnote", 'syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef', 'conceal') |
411 |
| - |
412 |
| -" regular footnotes |
413 |
| -syn region pandocFootnoteBlock start=/\[\^.\{-}\]:\s*\n*/ end=/^\n^\s\@!/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocNewLine,pandocStrongEmphasis,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell skipnl |
414 |
| -syn match pandocFootnoteBlockSeparator /:/ contained containedin=pandocFootnoteBlock |
415 |
| -syn match pandocFootnoteID /\[\^.\{-}\]/ contained containedin=pandocFootnoteBlock |
416 |
| -call s:WithConceal("footnote", 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID', 'conceal cchar='.s:cchars["footnote"]) |
417 |
| -call s:WithConceal("footnote", 'syn match pandocFootnoteIDTail /\]/ contained containedin=pandocFootnoteID', 'conceal') |
418 |
| -" }}} |
419 |
| -" List Items: {{{2 |
420 |
| -" |
421 |
| -" Unordered lists |
422 |
| -syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocReferenceURL,pandocAutomaticLink skipempty display |
423 |
| -call s:WithConceal('list', 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem', 'conceal cchar='.s:cchars['li']) |
424 |
| - |
425 |
| -" Ordered lists |
426 |
| -syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink skipempty display |
427 |
| -" support for roman numerals up to 'c' |
428 |
| -if g:pandoc#syntax#roman_lists != 0 |
429 |
| - syn match pandocListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display |
430 |
| -endif |
431 |
| -syn match pandocListItemBullet /^(\?.\{-}[.)]/ contained containedin=pandocListItem |
432 |
| -syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}\)/ contained containedin=pandocListItemBullet |
433 |
| - |
434 |
| -syn match pandocListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@<!\([[:alpha:]ñäëïöüáéíóúàèìòùłßÄËÏÖÜÁÉÍÓÚÀÈÌÒÙŁß_"[]\|\*\S\)\@=.*$/ nextgroup=pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocListItem contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocReferenceURL,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink contained skipempty display |
435 |
| -" }}} |
436 |
| -" Definitions: {{{2 |
437 |
| -" |
438 |
| -syn region pandocDefinitionBlock start=/^\%(\_^\s*\([`~]\)\1\{2,}\)\@!.*\n\(^\s*\n\)\=\s\{0,2}[:~]\(\~\{2,}\~*\)\@!/ skip=/\n\n\zs\s/ end=/\n\n/ contains=pandocDefinitionBlockMark,pandocDefinitionBlockTerm,pandocCodeBlockInsideIndent,pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocFootnoteID,pandocReferenceURL,pandocReferenceLabel,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocAutomaticLink,pandocEmDash,pandocEnDash |
439 |
| -syn match pandocDefinitionBlockTerm /^.*\n\(^\s*\n\)\=\(\s*[:~]\)\@=/ contained contains=pandocNoFormatted,pandocEmphasis,pandocStrong,pandocLaTeXInlineMath nextgroup=pandocDefinitionBlockMark |
440 |
| -call s:WithConceal("definition", 'syn match pandocDefinitionBlockMark /^\s*[:~]/ contained', 'conceal cchar='.s:cchars["definition"]) |
441 |
| -" }}} |
442 |
| -" Special: {{{2 |
443 |
| - |
444 |
| -" New_lines: {{{3 |
445 |
| -if g:pandoc#syntax#newlines == 1 |
446 |
| - call s:WithConceal("newline", 'syn match pandocNewLine /\( \|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars["newline"]) |
447 |
| -endif |
448 |
| -"}}} |
449 |
| -" Emdashes: {{{3 |
450 |
| -if &encoding == "utf-8" |
451 |
| - call s:WithConceal("emdashes", 'syn match pandocEllipses /\([^-]\)\@<=---\([^-]\)\@=/ display', 'conceal cchar=—') |
452 |
| -endif |
453 |
| -" }}} |
454 |
| -" Endashes: {{{3 |
455 |
| -if &encoding == "utf-8" |
456 |
| - call s:WithConceal("endashes", 'syn match pandocEllipses /\([^-]\)\@<=--\([^-]\)\@=/ display', 'conceal cchar=–') |
457 |
| -endif |
458 |
| -" }}} |
459 |
| -" Ellipses: {{{3 |
460 |
| -if &encoding == "utf-8" |
461 |
| - call s:WithConceal("ellipses", 'syn match pandocEllipses /\.\.\./ display', 'conceal cchar=…') |
462 |
| -endif |
463 |
| -" }}} |
464 |
| -" Quotes: {{{3 |
465 |
| -if &encoding == "utf-8" |
466 |
| - call s:WithConceal("quotes", 'syn match pandocBeginQuote /"\</ containedin=pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display', 'conceal cchar=“') |
467 |
| - call s:WithConceal("quotes", 'syn match pandocEndQuote /\(\>[[:punct:]]*\)\@<="[[:blank:][:punct:]\n]\@=/ containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display', 'conceal cchar=”') |
468 |
| -endif |
469 |
| -" Hrule: {{{3 |
470 |
| -syn match pandocHRule /^\s*\([*\-_]\)\s*\%(\1\s*\)\{2,}$/ display |
471 |
| -" Backslashes: {{{3 |
472 |
| -if g:pandoc#syntax#conceal#backslash == 1 |
473 |
| - syn match pandocBackslash /\\\@<!\\/ containedin=ALLBUT,pandocCodeblock,pandocCodeBlockInsideIndent,pandocNoFormatted,pandocNoFormattedInEmphasis,pandocNoFormattedInStrong,pandocDelimitedCodeBlock,pandocLineBlock,pandocYAMLHeader conceal |
474 |
| -endif |
475 |
| -" }}} |
476 |
| -" }}} |
477 |
| -" YAML: {{{2 |
478 |
| - |
479 |
| -try |
480 |
| - unlet! b:current_syntax |
481 |
| - syn include @YAML syntax/yaml.vim |
482 |
| -catch /E484/ |
483 |
| -endtry |
484 |
| -syn region pandocYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^\([-.]\)\1\{2}$/ keepend contains=@YAML containedin=TOP |
485 |
| -"}}} |
486 |
| -"}}}1 |
487 |
| - |
488 |
| -" Styling: {{{1 |
489 |
| -" override this for consistency |
490 |
| -hi pandocTitleBlock term=italic gui=italic |
491 |
| -hi link pandocTitleBlockTitle Directory |
492 |
| -hi link pandocAtxHeader Title |
493 |
| -hi link pandocAtxStart Operator |
494 |
| -hi link pandocSetexHeader Title |
495 |
| -hi link pandocHeaderAttr Comment |
496 |
| -hi link pandocHeaderID Identifier |
497 |
| - |
498 |
| -hi link pandocLaTexSectionCmd texSection |
499 |
| -hi link pandocLaTeXDelimiter texDelimiter |
500 |
| - |
501 |
| -hi link pandocHTMLComment Comment |
502 |
| -hi link pandocHTMLCommentStart Delimiter |
503 |
| -hi link pandocHTMLCommentEnd Delimiter |
504 |
| -hi link pandocBlockQuote Comment |
505 |
| -hi link pandocBlockQuoteMark Comment |
506 |
| - |
507 |
| -" if the user sets g:pandoc#syntax#codeblocks#ignore to contain |
508 |
| -" a codeblock type, don't highlight it so that it remains Normal |
| 7 | +scriptencoding utf-8 |
509 | 8 |
|
510 |
| -if index(g:pandoc#syntax#codeblocks#ignore, 'definition') == -1 |
511 |
| - hi link pandocCodeBlockInsideIndent String |
| 9 | +if exists('b:current_syntax') |
| 10 | + finish |
512 | 11 | endif
|
513 | 12 |
|
514 |
| -if index(g:pandoc#syntax#codeblocks#ignore, 'delimited') == -1 |
515 |
| - hi link pandocDelimitedCodeBlock Special |
| 13 | +if !exists('b:is_legacy') |
| 14 | + let b:is_legacy = exists('g:pandoc_legacy') |
516 | 15 | endif
|
517 | 16 |
|
518 |
| -hi link pandocDelimitedCodeBlockStart Delimiter |
519 |
| -hi link pandocDelimitedCodeBlockEnd Delimiter |
520 |
| -hi link pandocDelimitedCodeBlockLanguage Comment |
521 |
| -hi link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote |
522 |
| -hi link pandocCodePre String |
523 |
| - |
524 |
| -hi link pandocLineBlockDelimiter Delimiter |
525 |
| - |
526 |
| -hi link pandocListItemBullet Operator |
527 |
| -hi link pandocUListItemBullet Operator |
528 |
| -hi link pandocListItemBulletId Identifier |
529 |
| - |
530 |
| -hi link pandocReferenceLabel Label |
531 |
| -hi link pandocReferenceURL Underlined |
532 |
| -hi link pandocLinkTip Identifier |
533 |
| -hi link pandocImageIcon Operator |
534 |
| - |
535 |
| -hi link pandocReferenceDefinition Operator |
536 |
| -hi link pandocReferenceDefinitionLabel Label |
537 |
| -hi link pandocReferenceDefinitionAddress Underlined |
538 |
| -hi link pandocReferenceDefinitionTip Identifier |
539 |
| - |
540 |
| -hi link pandocAutomaticLink Underlined |
541 |
| - |
542 |
| -hi link pandocDefinitionBlockTerm Identifier |
543 |
| -hi link pandocDefinitionBlockMark Operator |
544 |
| - |
545 |
| -hi link pandocSimpleTableDelims Delimiter |
546 |
| -hi link pandocSimpleTableHeader pandocStrong |
547 |
| -hi link pandocTableMultilineHeader pandocStrong |
548 |
| -hi link pandocTableDelims Delimiter |
549 |
| -hi link pandocGridTableDelims Delimiter |
550 |
| -hi link pandocGridTableHeader Delimiter |
551 |
| -hi link pandocPipeTableDelims Delimiter |
552 |
| -hi link pandocPipeTableHeader Delimiter |
553 |
| -hi link pandocTableHeaderWord pandocStrong |
554 |
| - |
555 |
| -hi link pandocAbbreviationHead Type |
556 |
| -hi link pandocAbbreviation Label |
557 |
| -hi link pandocAbbreviationTail Type |
558 |
| -hi link pandocAbbreviationSeparator Identifier |
559 |
| -hi link pandocAbbreviationDefinition Comment |
560 |
| - |
561 |
| -hi link pandocFootnoteID Label |
562 |
| -hi link pandocFootnoteIDHead Type |
563 |
| -hi link pandocFootnoteIDTail Type |
564 |
| -hi link pandocFootnoteDef Comment |
565 |
| -hi link pandocFootnoteDefHead Type |
566 |
| -hi link pandocFootnoteDefTail Type |
567 |
| -hi link pandocFootnoteBlock Comment |
568 |
| -hi link pandocFootnoteBlockSeparator Operator |
569 |
| - |
570 |
| -hi link pandocPCite Normal |
571 |
| -hi link pandocICite Normal |
572 |
| -hi link pandocCiteKey Identifier |
573 |
| -hi link pandocCiteAnchor Operator |
574 |
| -hi link pandocCiteLocator Operator |
575 |
| - |
576 |
| -if g:pandoc#syntax#style#emphases == 1 |
577 |
| - hi pandocEmphasis gui=italic cterm=italic |
578 |
| - hi pandocStrong gui=bold cterm=bold |
579 |
| - hi pandocStrongEmphasis gui=bold,italic cterm=bold,italic |
580 |
| - hi pandocStrongInEmphasis gui=bold,italic cterm=bold,italic |
581 |
| - hi pandocEmphasisInStrong gui=bold,italic cterm=bold,italic |
582 |
| - if !exists('s:hi_tail') |
583 |
| - for s:i in ["fg", "bg"] |
584 |
| - let s:tmp_val = synIDattr(synIDtrans(hlID("String")), s:i) |
585 |
| - let s:tmp_ui = has('gui_running') || has('nvim') ? 'gui' : 'cterm' |
586 |
| - if !empty(s:tmp_val) && s:tmp_val != -1 |
587 |
| - exe 'let s:'.s:i . ' = "'.s:tmp_ui.s:i.'='.s:tmp_val.'"' |
588 |
| - else |
589 |
| - exe 'let s:'.s:i . ' = ""' |
590 |
| - endif |
591 |
| - endfor |
592 |
| - let s:hi_tail = ' '.s:fg.' '.s:bg |
593 |
| - endif |
594 |
| - exe 'hi pandocNoFormattedInEmphasis gui=italic cterm=italic'.s:hi_tail |
595 |
| - exe 'hi pandocNoFormattedInStrong gui=bold cterm=bold'.s:hi_tail |
596 |
| -endif |
597 |
| -hi link pandocNoFormatted String |
598 |
| -hi link pandocNoFormattedAttrs Comment |
599 |
| -hi link pandocSubscriptMark Operator |
600 |
| -hi link pandocSuperscriptMark Operator |
601 |
| -hi link pandocStrikeoutMark Operator |
602 |
| -if g:pandoc#syntax#style#underline_special == 1 |
603 |
| - hi pandocSubscript gui=underline cterm=underline |
604 |
| - hi pandocSuperscript gui=underline cterm=underline |
605 |
| - hi pandocStrikeout gui=underline cterm=underline |
| 17 | +if b:is_legacy |
| 18 | + runtime syntax/pandoc_legacy.vim |
| 19 | +else |
| 20 | + runtime syntax/pandoc_commonmark.vim |
606 | 21 | endif
|
607 |
| -hi link pandocNewLine Error |
608 |
| -hi link pandocHRule Delimiter |
609 |
| - |
610 |
| -"}}} |
611 |
| - |
612 |
| -let b:current_syntax = "pandoc" |
613 | 22 |
|
614 |
| -syntax sync clear |
615 |
| -syntax sync minlines=100 |
| 23 | +let b:current_syntax = b:is_legacy ? 'pandoc' : 'pandoc_legacy' |
0 commit comments