Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 5e0bfa8

Browse files
committedMay 14, 2020
chore: Relegate current syntax to legacy mode
1 parent 0d1129e commit 5e0bfa8

File tree

3 files changed

+713
-684
lines changed

3 files changed

+713
-684
lines changed
 

‎syntax/pandoc.vim

Lines changed: 6 additions & 684 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
scriptencoding utf-8
2-
" vim: set fdm=marker foldlevel=0:
3-
"
41
" Vim syntax file
52
"
63
" Language: Pandoc (superset of Markdown)
@@ -9,692 +6,17 @@ scriptencoding utf-8
96
" Contributor: David Sanson <dsanson@gmail.com>
107
" Contributor: Jorge Israel Peña <jorge.israel.p@gmail.com>
118
" OriginalAuthor: Jeremy Schultz <taozhyn@gmail.com>
12-
" Version: 5.0
13-
14-
" Configuration: {{{1
15-
"
16-
" use conceal? {{{2
17-
if !exists('g:pandoc#syntax#conceal#use')
18-
if v:version < 703
19-
let g:pandoc#syntax#conceal#use = 0
20-
else
21-
let g:pandoc#syntax#conceal#use = 1
22-
endif
23-
else
24-
" exists, but we cannot use it, disable anyway
25-
if v:version < 703
26-
let g:pandoc#syntax#conceal#use = 0
27-
endif
28-
endif
29-
"}}}2
30-
31-
" what groups not to use conceal in. works as a blacklist {{{2
32-
if !exists('g:pandoc#syntax#conceal#blacklist')
33-
let g:pandoc#syntax#conceal#blacklist = []
34-
endif
35-
" }}}2
36-
37-
" cchars used in conceal rules {{{2
38-
" utf-8 defaults (preferred)
39-
if &encoding ==# 'utf-8'
40-
let s:cchars = {
41-
\'newline': '↵',
42-
\'image': '▨',
43-
\'super': 'ⁿ',
44-
\'sub': 'ₙ',
45-
\'strike': 'x̶',
46-
\'atx': '§',
47-
\'codelang': 'λ',
48-
\'codeend': '—',
49-
\'abbrev': '→',
50-
\'footnote': '†',
51-
\'definition': ' ',
52-
\'li': '•',
53-
\'html_c_s': '‹',
54-
\'html_c_e': '›'}
55-
else
56-
" ascii defaults
57-
let s:cchars = {
58-
\'newline': ' ',
59-
\'image': 'i',
60-
\'super': '^',
61-
\'sub': '_',
62-
\'strike': '~',
63-
\'atx': '#',
64-
\'codelang': 'l',
65-
\'codeend': '-',
66-
\'abbrev': 'a',
67-
\'footnote': 'f',
68-
\'definition': ' ',
69-
\'li': '*',
70-
\'html_c_s': '+',
71-
\'html_c_e': '+'}
72-
endif
73-
" }}}2
74-
75-
" if the user has a dictionary with replacements for the default cchars, use those {{{2
76-
if exists('g:pandoc#syntax#conceal#cchar_overrides')
77-
let s:cchars = extend(s:cchars, g:pandoc#syntax#conceal#cchar_overrides)
78-
endif
79-
" }}}2
80-
81-
"should the urls in links be concealed? {{{2
82-
if !exists('g:pandoc#syntax#conceal#urls')
83-
let g:pandoc#syntax#conceal#urls = 0
84-
endif
85-
" should backslashes in escapes be concealed? {{{2
86-
if !exists('g:pandoc#syntax#conceal#backslash')
87-
let g:pandoc#syntax#conceal#backslash = 0
88-
endif
89-
" }}}2
90-
91-
" leave specified codeblocks as Normal (i.e. 'unhighlighted') {{{2
92-
if !exists('g:pandoc#syntax#codeblocks#ignore')
93-
let g:pandoc#syntax#codeblocks#ignore = []
94-
endif
95-
" }}}2
96-
97-
" use embedded highlighting for delimited codeblocks where a language is specifed. {{{2
98-
if !exists('g:pandoc#syntax#codeblocks#embeds#use')
99-
let g:pandoc#syntax#codeblocks#embeds#use = 1
100-
endif
101-
" }}}2
102-
103-
" for what languages and using what vim syntax files highlight those embeds. {{{2
104-
" defaults to None.
105-
if !exists('g:pandoc#syntax#codeblocks#embeds#langs')
106-
let g:pandoc#syntax#codeblocks#embeds#langs = []
107-
endif
108-
" }}}2
109-
110-
" use italics ? {{{2
111-
if !exists('g:pandoc#syntax#style#emphases')
112-
let g:pandoc#syntax#style#emphases = 1
113-
endif
114-
" if 0, we don't conceal the emphasis marks, otherwise there wouldn't be a way
115-
" to tell where the styles apply.
116-
if g:pandoc#syntax#style#emphases == 0
117-
call add(g:pandoc#syntax#conceal#blacklist, 'block')
118-
endif
119-
" }}}2
120-
121-
" underline subscript, superscript and strikeout? {{{2
122-
if !exists('g:pandoc#syntax#style#underline_special')
123-
let g:pandoc#syntax#style#underline_special = 1
124-
endif
125-
" }}}2
126-
127-
" protect code blocks? {{{2
128-
if !exists('g:pandoc#syntax#protect#codeblocks')
129-
let g:pandoc#syntax#protect#codeblocks = 1
130-
endif
131-
" }}}2
132-
133-
" use color column? {{{2
134-
if !exists('g:pandoc#syntax#colorcolumn')
135-
let g:pandoc#syntax#colorcolumn = 0
136-
endif
137-
" }}}2
138-
139-
" highlight new lines? {{{2
140-
if !exists('g:pandoc#syntax#newlines')
141-
let g:pandoc#syntax#newlines = 1
142-
endif
143-
" }}}
144-
145-
" detect roman-numeral list items? {{{2
146-
if !exists('g:pandoc#syntax#roman_lists')
147-
let g:pandoc#syntax#roman_lists = 0
148-
endif
149-
" }}}2
1509

151-
" disable syntax highlighting for definition lists? (better performances) {{{2
152-
if !exists('g:pandoc#syntax#use_definition_lists')
153-
let g:pandoc#syntax#use_definition_lists = 1
154-
endif
155-
" }}}2
156-
157-
" }}}1
158-
159-
" Functions: {{{1
160-
" EnableEmbedsforCodeblocksWithLang {{{2
161-
function! EnableEmbedsforCodeblocksWithLang(entry)
162-
" prevent embedded language syntaxes from changing 'foldmethod'
163-
if has('folding')
164-
let s:foldmethod = &l:foldmethod
165-
endif
166-
167-
try
168-
let s:langname = matchstr(a:entry, '^[^=]*')
169-
let s:langsyntaxfile = matchstr(a:entry, '[^=]*$')
170-
unlet! b:current_syntax
171-
exe 'syn include @'.toupper(s:langname).' syntax/'.s:langsyntaxfile.'.vim'
172-
exe 'syn region pandocDelimitedCodeBlock_' . s:langname . ' start=/\(\_^\([ ]\{4,}\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>.*\n\)\@<=\_^/' .
173-
\' end=/\_$\n\(\([ ]\{4,}\|\t\)\=\(`\{3,}`*\|\~\{3,}\~*\)\_$\n\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock' .
174-
\' contains=@' . toupper(s:langname)
175-
exe 'syn region pandocDelimitedCodeBlockinBlockQuote_' . s:langname . ' start=/>\s\(`\{3,}`*\|\~\{3,}\~*\)\s*\%({[^.]*\.\)\=' . s:langname . '\>/' .
176-
\ ' end=/\(`\{3,}`*\|\~\{3,}\~*\)/ contained containedin=pandocDelimitedCodeBlock' .
177-
\' contains=@' . toupper(s:langname) .
178-
\',pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd,pandodDelimitedCodeblockLang,pandocBlockQuoteinDelimitedCodeBlock'
179-
catch /E484/
180-
echo "No syntax file found for '" . s:langsyntaxfile . "'"
181-
endtry
182-
183-
if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod
184-
let &l:foldmethod = s:foldmethod
185-
endif
186-
endfunction
187-
" }}}2
188-
189-
" DisableEmbedsforCodeblocksWithLang {{{2
190-
function! DisableEmbedsforCodeblocksWithLang(langname)
191-
try
192-
exe 'syn clear pandocDelimitedCodeBlock_'.a:langname
193-
exe 'syn clear pandocDelimitedCodeBlockinBlockQuote_'.a:langname
194-
catch /E28/
195-
echo "No existing highlight definitions found for '" . a:langname . "'"
196-
endtry
197-
endfunction
198-
" }}}2
199-
200-
" WithConceal {{{2
201-
function! s:WithConceal(rule_group, rule, conceal_rule)
202-
let l:rule_tail = ''
203-
if g:pandoc#syntax#conceal#use != 0
204-
if index(g:pandoc#syntax#conceal#blacklist, a:rule_group) == -1
205-
let l:rule_tail = ' ' . a:conceal_rule
206-
endif
207-
endif
208-
execute a:rule . l:rule_tail
209-
endfunction
210-
" }}}2
211-
212-
" }}}1
213-
214-
" Commands: {{{1
215-
command! -buffer -nargs=1 -complete=syntax PandocHighlight call EnableEmbedsforCodeblocksWithLang(<f-args>)
216-
command! -buffer -nargs=1 -complete=syntax PandocUnhighlight call DisableEmbedsforCodeblocksWithLang(<f-args>)
217-
" }}}1
218-
219-
" BASE:
220-
syntax clear
221-
syntax spell toplevel
222-
" apply extra settings: {{{1
223-
if g:pandoc#syntax#colorcolumn == 1
224-
exe 'setlocal colorcolumn='.string(&textwidth+5)
225-
elseif g:pandoc#syntax#colorcolumn == 2
226-
exe 'setlocal colorcolumn='.join(range(&textwidth+5, 2*&columns), ',')
227-
endif
228-
if g:pandoc#syntax#conceal#use != 0
229-
setlocal conceallevel=2
230-
endif
231-
" }}}1
232-
233-
" Syntax Rules: {{{1
234-
235-
" Embeds: {{{2
236-
237-
" prevent embedded language syntaxes from changing 'foldmethod'
238-
if has('folding')
239-
let s:foldmethod = &l:foldmethod
240-
endif
241-
242-
" HTML: {{{3
243-
" Set embedded HTML highlighting
244-
syn include @HTML syntax/html.vim
245-
syn match pandocHTML /<\/\?\a.\{-}>/ contains=@HTML
246-
" Support HTML multi line comments
247-
syn region pandocHTMLComment start=/<!--\s\=/ end=/\s\=-->/ keepend contains=pandocHTMLCommentStart,pandocHTMLCommentEnd
248-
call s:WithConceal('html_c_s', 'syn match pandocHTMLCommentStart /<!--/ contained', 'conceal cchar='.s:cchars['html_c_s'])
249-
call s:WithConceal('html_c_e', 'syn match pandocHTMLCommentEnd /-->/ contained', 'conceal cchar='.s:cchars['html_c_e'])
250-
" }}}3
251-
252-
" LaTeX: {{{3
253-
" Set embedded LaTex (pandoc extension) highlighting
254-
" Unset current_syntax so the 2nd include will work
255-
unlet b:current_syntax
256-
syn include @LATEX syntax/tex.vim
257-
syn region pandocLaTeXInlineMath start=/\v\\@<!\$\S@=/ end=/\v\\@<!\$\d@!/ keepend contains=@LATEX
258-
syn region pandocLaTeXInlineMath start=/\\\@<!\\(/ end=/\\\@<!\\)/ keepend contains=@LATEX
259-
syn match pandocEscapedDollar /\\\$/ conceal cchar=$
260-
syn match pandocProtectedFromInlineLaTeX /\\\@<!\${.*}\(\(\s\|[[:punct:]]\)\([^$]*\|.*\(\\\$.*\)\{2}\)\n\n\|$\)\@=/ display
261-
" contains=@LATEX
262-
syn region pandocLaTeXMathBlock start=/\$\$/ end=/\$\$/ keepend contains=@LATEX
263-
syn region pandocLaTeXMathBlock start=/\\\@<!\\\[/ end=/\\\@<!\\\]/ keepend contains=@LATEX
264-
syn match pandocLaTeXCommand /\\[[:alpha:]]\+\(\({.\{-}}\)\=\(\[.\{-}\]\)\=\)*/ contains=@LATEX
265-
syn region pandocLaTeXRegion start=/\\begin{\z(.\{-}\)}/ end=/\\end{\z1}/ keepend contains=@LATEX
266-
" we rehighlight sectioning commands, because otherwise tex.vim captures all text until EOF or a new sectioning command
267-
syn region pandocLaTexSection start=/\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)\*\=\(\[.*\]\)\={/ end=/\}/ keepend
268-
syn match pandocLaTexSectionCmd /\\\(part\|chapter\|\(sub\)\{,2}section\|\(sub\)\=paragraph\)/ contained containedin=pandocLaTexSection
269-
syn match pandocLaTeXDelimiter /[[\]{}]/ contained containedin=pandocLaTexSection
270-
" }}}3
271-
272-
if exists('s:foldmethod') && s:foldmethod !=# &l:foldmethod
273-
let &l:foldmethod = s:foldmethod
274-
endif
275-
276-
" }}}2
277-
278-
" Titleblock: {{{2
279-
syn region pandocTitleBlock start=/\%^%/ end=/\n\n/ contains=pandocReferenceLabel,pandocReferenceURL,pandocNewLine
280-
call s:WithConceal('titleblock', 'syn match pandocTitleBlockMark /%\ / contained containedin=pandocTitleBlock,pandocTitleBlockTitle', 'conceal')
281-
syn match pandocTitleBlockTitle /\%^%.*\n/ contained containedin=pandocTitleBlock
282-
" }}}2
283-
284-
" Blockquotes: {{{2
285-
syn match pandocBlockQuote /^\s\{,3}>.*\n\(.*\n\@1<!\n\)*/ contains=@Spell,pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted,pandocAmpersandEscape,pandocLaTeXInlineMath,pandocEscapedDollar,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXRegion skipnl
286-
syn match pandocBlockQuoteMark /\_^\s\{,3}>/ contained containedin=pandocEmphasis,pandocStrong,pandocPCite,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocUListItem,pandocNoFormatted
287-
" }}}2
10+
scriptencoding utf-8
28811

289-
" Code Blocks: {{{2
290-
if g:pandoc#syntax#protect#codeblocks == 1
291-
syn match pandocCodeblock /\([ ]\{4}\|\t\).*$/
12+
if exists('b:current_syntax')
13+
finish
29214
endif
293-
syn region pandocCodeBlockInsideIndent start=/\(\(\d\|\a\|*\).*\n\)\@<!\(^\(\s\{8,}\|\t\+\)\).*\n/ end=/.\(\n^\s*\n\)\@=/ contained
294-
" }}}2
295-
296-
" Links: {{{2
29715

298-
" Base: {{{3
299-
syn region pandocReferenceLabel matchgroup=pandocOperator start=/!\{,1}\\\@<!\^\@<!\[/ skip=/\(\\\@<!\]\]\@=\|`.*\\\@<!].*`\)/ end=/\\\@<!\]/ keepend display
300-
if g:pandoc#syntax#conceal#urls == 1
301-
syn region pandocReferenceURL matchgroup=pandocOperator start=/\]\@1<=(/ end=/)/ keepend conceal
16+
if exists('g:pandoc#syntax#flavor#commonmark') || exists('b:pandoc#syntax#flavor#commonmark')
17+
runtime syntax/pandoc_commonmark.vim
30218
else
303-
syn region pandocReferenceURL matchgroup=pandocOperator start=/\]\@1<=(/ end=/)/ keepend
19+
runtime syntax/pandoc_legacy.vim
30420
endif
305-
" let's not consider "a [label] a" as a label, remove formatting - Note: breaks implicit links
306-
syn match pandocNoLabel /\]\@1<!\(\s\{,3}\|^\)\[[^\[\]]\{-}\]\(\s\+\|$\)[\[(]\@!/ contains=pandocPCite
307-
syn match pandocLinkTip /\s*".\{-}"/ contained containedin=pandocReferenceURL contains=@Spell,pandocAmpersandEscape display
308-
call s:WithConceal('image', 'syn match pandocImageIcon /!\[\@=/ display', 'conceal cchar='. s:cchars['image'])
309-
" }}}3
310-
311-
" Definitions: {{{3
312-
syn region pandocReferenceDefinition start="!\=\[\%(\_[^]]*]\%( \=[[(]\)\)\@=" end="\]\%( \=[[(]\)\@=" keepend
313-
syn match pandocReferenceDefinitionLabel /\[\zs.\{-}\ze\]:/ contained containedin=pandocReferenceDefinition display
314-
syn match pandocReferenceDefinitionAddress /:\s*\zs.*/ contained containedin=pandocReferenceDefinition
315-
syn match pandocReferenceDefinitionTip /\s*".\{-}"/ contained containedin=pandocReferenceDefinition,pandocReferenceDefinitionAddress contains=@Spell,pandocAmpersandEscape
316-
" }}}3
317-
318-
" Automatic_links: {{{3
319-
syn match pandocAutomaticLink /<\(https\{0,1}.\{-}\|[A-Za-z0-9!#$%&'*+\-/=?^_`{|}~.]\{-}@[A-Za-z0-9\-]\{-}\.\w\{-}\)>/ contains=NONE
320-
" }}}3
321-
322-
" }}}2
323-
324-
" Citations: {{{2
325-
" parenthetical citations
326-
syn match pandocPCite "\^\@<!\[[^\[\]]\{-}-\{0,1}@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*.\{-}\]" contains=pandocEmphasis,pandocStrong,pandocLatex,pandocCiteKey,@Spell,pandocAmpersandEscape display
327-
" in-text citations with location
328-
syn match pandocICite "@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\s\[.\{-1,}\]" contains=pandocCiteKey,@Spell display
329-
" cite keys
330-
syn match pandocCiteKey /\(-\=@[[:alnum:]_][[:digit:][:lower:][:upper:]_:.#$%&\-+?<>~/]*\)/ containedin=pandocPCite,pandocICite contains=@NoSpell display
331-
syn match pandocCiteAnchor /[-@]/ contained containedin=pandocCiteKey display
332-
syn match pandocCiteLocator /[\[\]]/ contained containedin=pandocPCite,pandocICite
333-
" }}}2
334-
335-
" Text Styles: {{{2
336-
337-
" Emphasis: {{{3
338-
call s:WithConceal('block', 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\*\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends')
339-
call s:WithConceal('block', 'syn region pandocEmphasis matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@1<=_\([[:punct:]]\|\s\|\_$\)\@=/ contains=@Spell,pandocNoFormattedInEmphasis,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends')
340-
" }}}3
341-
342-
" Strong: {{{3
343-
call s:WithConceal('block', 'syn region pandocStrong matchgroup=pandocOperator start=/\(\\\@<!\*\)\{2}/ end=/\(\\\@<!\*\)\{2}/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends')
344-
call s:WithConceal('block', 'syn region pandocStrong matchgroup=pandocOperator start=/__/ end=/__/ contains=@Spell,pandocNoFormattedInStrong,pandocLatexInlineMath,pandocAmpersandEscape', 'concealends')
345-
" }}}3
346-
347-
" Strong Emphasis: {{{3
348-
call s:WithConceal('block', 'syn region pandocStrongEmphasis matchgroup=pandocOperator start=/\*\{3}\(\S[^*]*\(\*\S\|\n[^*]*\*\S\)\)\@=/ end=/\S\@<=\*\{3}/ contains=@Spell,pandocAmpersandEscape', 'concealends')
349-
call s:WithConceal('block', 'syn region pandocStrongEmphasis matchgroup=pandocOperator start=/\(___\)\S\@=/ end=/\S\@<=___/ contains=@Spell,pandocAmpersandEscape', 'concealends')
350-
" }}}3
351-
352-
" Mixed: {{{3
353-
call s:WithConceal('block', 'syn region pandocStrongInEmphasis matchgroup=pandocOperator start=/\*\*/ end=/\*\*/ contained containedin=pandocEmphasis contains=@Spell,pandocAmpersandEscape', 'concealends')
354-
call s:WithConceal('block', 'syn region pandocStrongInEmphasis matchgroup=pandocOperator start=/__/ end=/__/ contained containedin=pandocEmphasis contains=@Spell,pandocAmpersandEscape', 'concealends')
355-
call s:WithConceal('block', 'syn region pandocEmphasisInStrong matchgroup=pandocOperator start=/\\\@1<!\(\_^\|\s\|[[:punct:]]\)\@<=\*\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=\*\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell,pandocAmpersandEscape', 'concealends')
356-
call s:WithConceal('block', 'syn region pandocEmphasisInStrong matchgroup=pandocOperator start=/\\\@<!\(\_^\|\s\|[[:punct:]]\)\@<=_\S\@=/ skip=/\(\*\*\|__\)/ end=/\S\@<=_\([[:punct:]]\|\s\|\_$\)\@=/ contained containedin=pandocStrong contains=@Spell,pandocAmpersandEscape', 'concealends')
357-
" }}}3
358-
359-
" Inline Code: {{{3
360-
" Using single back ticks
361-
call s:WithConceal('inlinecode', 'syn region pandocNoFormatted matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs', 'concealends')
362-
call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInEmphasis matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained', 'concealends')
363-
call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!`/ end=/\\\@<!`/ nextgroup=pandocNoFormattedAttrs contained', 'concealends')
364-
" Using double back ticks
365-
call s:WithConceal('inlinecode', 'syn region pandocNoFormatted matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs', 'concealends')
366-
call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInEmphasis matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends')
367-
call s:WithConceal('inlinecode', 'syn region pandocNoFormattedInStrong matchgroup=pandocOperator start=/\\\@<!``/ end=/\\\@<!``/ nextgroup=pandocNoFormattedAttrs contained', 'concealends')
368-
syn match pandocNoFormattedAttrs /{.\{-}}/ contained
369-
" }}}3
370-
371-
" Subscripts: {{{3
372-
syn region pandocSubscript start=/\~\(\([[:graph:]]\(\\ \)\=\)\{-}\~\)\@=/ end=/\~/ keepend
373-
call s:WithConceal('subscript', 'syn match pandocSubscriptMark /\~/ contained containedin=pandocSubscript', 'conceal cchar='.s:cchars['sub'])
374-
" }}}3
375-
376-
" Superscript: {{{3
377-
syn region pandocSuperscript start=/\^\(\([[:graph:]]\(\\ \)\=\)\{-}\^\)\@=/ skip=/\\ / end=/\^/ keepend
378-
call s:WithConceal('superscript', 'syn match pandocSuperscriptMark /\^/ contained containedin=pandocSuperscript', 'conceal cchar='.s:cchars['super'])
379-
" }}}3
380-
381-
" Strikeout: {{{3
382-
syn region pandocStrikeout start=/\~\~/ end=/\~\~/ contains=@Spell,pandocAmpersandEscape keepend
383-
call s:WithConceal('strikeout', 'syn match pandocStrikeoutMark /\~\~/ contained containedin=pandocStrikeout', 'conceal cchar='.s:cchars['strike'])
384-
" }}}3
385-
386-
" }}}2
387-
388-
" Headers: {{{2
389-
syn match pandocAtxHeader /\(\%^\|<.\+>.*\n\|^\s*\n\)\@<=#\{1,6}.*\n/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape,pandocReferenceLabel,pandocReferenceURL display
390-
syn match pandocAtxHeaderMark /\(^#\{1,6}\|\\\@<!#\+\(\s*.*$\)\@=\)/ contained containedin=pandocAtxHeader
391-
call s:WithConceal('atx', 'syn match pandocAtxStart /#/ contained containedin=pandocAtxHeaderMark', 'conceal cchar='.s:cchars['atx'])
392-
syn match pandocSetexHeader /^.\+\n[=]\+$/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape
393-
syn match pandocSetexHeader /^.\+\n[-]\+$/ contains=pandocEmphasis,pandocStrong,pandocNoFormatted,pandocLaTeXInlineMath,pandocEscapedDollar,@Spell,pandocAmpersandEscape
394-
syn match pandocHeaderAttr /{.*}/ contained containedin=pandocAtxHeader,pandocSetexHeader
395-
syn match pandocHeaderID /#[-_:.[:lower:][:upper:]]*/ contained containedin=pandocHeaderAttr
396-
" }}}2
397-
398-
" Line Blocks: {{{2
399-
syn region pandocLineBlock start=/^|/ end=/\(^|\(.*\n|\@!\)\@=.*\)\@<=\n/ transparent
400-
syn match pandocLineBlockDelimiter /^|/ contained containedin=pandocLineBlock
401-
" }}}2
402-
403-
" Tables: {{{2
404-
405-
" Simple: {{{3
406-
syn region pandocSimpleTable start=/\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)\(-\{2,}\s*\)\+\n\n\@!/ end=/\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
407-
syn match pandocSimpleTableDelims /\-/ contained containedin=pandocSimpleTable
408-
syn match pandocSimpleTableHeader /\%#=2\(^.*[[:graph:]].*\n\)\@<!\(^.*[[:graph:]].*\n\)/ contained containedin=pandocSimpleTable
409-
410-
syn region pandocTable start=/\%#=2^\(-\{2,}\s*\)\+\n\n\@!/ end=/\%#=2^\(-\{2,}\s*\)\+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
411-
syn match pandocTableDelims /\-/ contained containedin=pandocTable
412-
syn region pandocTableMultilineHeader start=/\%#=2\(^-\{2,}\n\)\@<=./ end=/\%#=2\n-\@=/ contained containedin=pandocTable
413-
" }}}3
414-
415-
" Grid: {{{3
416-
syn region pandocGridTable start=/\%#=2\n\@1<=+-/ end=/+\n\n/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
417-
syn match pandocGridTableDelims /[\|=]/ contained containedin=pandocGridTable
418-
syn match pandocGridTableDelims /\%#=2\([\-+][\-+=]\@=\|[\-+=]\@1<=[\-+]\)/ contained containedin=pandocGridTable
419-
syn match pandocGridTableHeader /\%#=2\(^.*\n\)\(+=.*\)\@=/ contained containedin=pandocGridTable
420-
" }}}3
421-
422-
" Pipe: {{{3
423-
" with beginning and end pipes
424-
syn region pandocPipeTable start=/\%#=2\([+|]\n\)\@<!\n\@1<=|\(.*|\)\@=/ end=/|.*\n\(\n\|{\)/ containedin=ALLBUT,pandocDelimitedCodeBlock,pandocYAMLHeader keepend
425-
" without beginning and end pipes
426-
syn region pandocPipeTable start=/\%#=2^.*\n-.\{-}|/ end=/|.*\n\n/ keepend
427-
syn match pandocPipeTableDelims /[\|\-:+]/ contained containedin=pandocPipeTable
428-
syn match pandocPipeTableHeader /\(^.*\n\)\(|-\)\@=/ contained containedin=pandocPipeTable
429-
syn match pandocPipeTableHeader /\(^.*\n\)\(-\)\@=/ contained containedin=pandocPipeTable
430-
" }}}3
431-
432-
syn match pandocTableHeaderWord /\<.\{-}\>/ contained containedin=pandocGridTableHeader,pandocPipeTableHeader contains=@Spell
433-
" }}}2
434-
435-
" Delimited Code Blocks: {{{2
436-
" this is here because we can override strikeouts and subscripts
437-
syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\{4,}\|\t\)\=\~\{3,}\~*\)/ end=/^\z1\~*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
438-
syn region pandocDelimitedCodeBlock start=/^\(>\s\)\?\z(\([ ]\{4,}\|\t\)\=`\{3,}`*\)/ end=/^\z1`*/ skipnl contains=pandocDelimitedCodeBlockStart,pandocDelimitedCodeBlockEnd keepend
439-
call s:WithConceal('codeblock_start', 'syn match pandocDelimitedCodeBlockStart /\(\_^\n\_^\(>\s\)\?\([ ]\{4,}\|\t\)\=\)\@<=\(\~\{3,}\~*\|`\{3,}`*\)/ contained containedin=pandocDelimitedCodeBlock nextgroup=pandocDelimitedCodeBlockLanguage', 'conceal cchar='.s:cchars['codelang'])
440-
syn match pandocDelimitedCodeBlockLanguage /\(\s\?\)\@<=.\+\(\_$\)\@=/ contained
441-
call s:WithConceal('codeblock_delim', 'syn match pandocDelimitedCodeBlockEnd /\(`\{3,}`*\|\~\{3,}\~*\)\(\_$\n\(>\s\)\?\_$\)\@=/ contained containedin=pandocDelimitedCodeBlock', 'conceal cchar='.s:cchars['codeend'])
442-
syn match pandocBlockQuoteinDelimitedCodeBlock '^>' contained containedin=pandocDelimitedCodeBlock
443-
syn match pandocCodePre /<pre>.\{-}<\/pre>/ skipnl
444-
syn match pandocCodePre /<code>.\{-}<\/code>/ skipnl
445-
446-
" enable highlighting for embedded region in codeblocks if there exists a
447-
" g:pandoc#syntax#codeblocks#embeds#langs *list*.
448-
"
449-
" entries in this list are the language code interpreted by pandoc,
450-
" if this differs from the name of the vim syntax file, append =vimname
451-
" e.g. let g:pandoc#syntax#codeblocks#embeds#langs = ["haskell", "literatehaskell=lhaskell"]
452-
"
453-
if g:pandoc#syntax#codeblocks#embeds#use != 0
454-
for l in g:pandoc#syntax#codeblocks#embeds#langs
455-
call EnableEmbedsforCodeblocksWithLang(l)
456-
endfor
457-
endif
458-
" }}}2
459-
460-
" Abbreviations: {{{2
461-
syn region pandocAbbreviationDefinition start=/^\*\[.\{-}\]:\s*/ end='$' contains=pandocNoFormatted,@Spell,pandocAmpersandEscape
462-
call s:WithConceal('abbrev', 'syn match pandocAbbreviationSeparator /:/ contained containedin=pandocAbbreviationDefinition', 'conceal cchar='.s:cchars['abbrev'])
463-
syn match pandocAbbreviation /\*\[.\{-}\]/ contained containedin=pandocAbbreviationDefinition
464-
call s:WithConceal('abbrev', 'syn match pandocAbbreviationHead /\*\[/ contained containedin=pandocAbbreviation', 'conceal')
465-
call s:WithConceal('abbrev', 'syn match pandocAbbreviationTail /\]/ contained containedin=pandocAbbreviation', 'conceal')
466-
" }}}2
467-
468-
" Footnotes: {{{2
469-
" we put these here not to interfere with superscripts.
470-
syn match pandocFootnoteID /\[\^[^\]]\+\]/ nextgroup=pandocFootnoteDef
471-
472-
" Inline footnotes
473-
syn region pandocFootnoteDef start=/\^\[/ skip=/\[.\{-}]/ end=/\]/ contains=pandocReferenceLabel,pandocReferenceURL,pandocLatex,pandocPCite,pandocCiteKey,pandocStrong,pandocEmphasis,pandocStrongEmphasis,pandocNoFormatted,pandocSuperscript,pandocSubscript,pandocStrikeout,pandocEnDash,pandocEmDash,pandocEllipses,pandocBeginQuote,pandocEndQuote,@Spell,pandocAmpersandEscape skipnl keepend
474-
call s:WithConceal('footnote', 'syn match pandocFootnoteDefHead /\^\[/ contained containedin=pandocFootnoteDef', 'conceal cchar='.s:cchars['footnote'])
475-
call s:WithConceal('footnote', 'syn match pandocFootnoteDefTail /\]/ contained containedin=pandocFootnoteDef', 'conceal')
476-
477-
" regular footnotes
478-
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,pandocLaTeXInlineMath,pandocEscapedDollar,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXRegion,pandocAmpersandEscape,@Spell skipnl
479-
syn match pandocFootnoteBlockSeparator /:/ contained containedin=pandocFootnoteBlock
480-
syn match pandocFootnoteID /\[\^.\{-}\]/ contained containedin=pandocFootnoteBlock
481-
call s:WithConceal('footnote', 'syn match pandocFootnoteIDHead /\[\^/ contained containedin=pandocFootnoteID', 'conceal cchar='.s:cchars['footnote'])
482-
call s:WithConceal('footnote', 'syn match pandocFootnoteIDTail /\]/ contained containedin=pandocFootnoteID', 'conceal')
483-
" }}}2
484-
485-
" List Items: {{{2
486-
" Unordered lists
487-
syn match pandocUListItem /^>\=\s*[*+-]\s\+-\@!.*$/ nextgroup=pandocUListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocReferenceURL,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display
488-
call s:WithConceal('list', 'syn match pandocUListItemBullet /^>\=\s*\zs[*+-]/ contained containedin=pandocUListItem', 'conceal cchar='.s:cchars['li'])
489-
490-
" Ordered lists
491-
syn match pandocListItem /^\s*(\?\(\d\+\|\l\|\#\|@\)[.)].*$/ nextgroup=pandocListItem,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape skipempty display
492-
493-
" support for roman numerals up to 'c'
494-
if g:pandoc#syntax#roman_lists != 0
495-
syn match pandocListItem /^\s*(\?x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}[.)].*$/ nextgroup=pandocListItem,pandocMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocAutomaticLink skipempty display
496-
endif
497-
syn match pandocListItemBullet /^(\?.\{-}[.)]/ contained containedin=pandocListItem
498-
syn match pandocListItemBulletId /\(\d\+\|\l\|\#\|@.\{-}\|x\=l\=\(i\{,3}[vx]\=\)\{,3}c\{,3}\)/ contained containedin=pandocListItemBullet
499-
500-
syn match pandocListItemContinuation /^\s\+\([-+*]\s\+\|(\?.\+[).]\)\@<!\([[:upper:][:lower:]_"[]\|\*\S\)\@=.*$/ nextgroup=pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocDelimitedCodeBlock,pandocListItemContinuation,pandocListItem contains=@Spell,pandocEmphasis,pandocStrong,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocStrongEmphasis,pandocStrongEmphasis,pandocPCite,pandocICite,pandocCiteKey,pandocReferenceLabel,pandocReferenceURL,pandocLaTeXCommand,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID,pandocAmpersandEscape contained skipempty display
501-
" }}}2
502-
503-
" Definitions: {{{2
504-
if g:pandoc#syntax#use_definition_lists == 1
505-
syn region pandocDefinitionBlock start=/^\%(\_^\s*\([`~]\)\1\{2,}\)\@!.*\n\(^\s*\n\)\=\s\{0,2}\([:~]\)\(\3\{2,}\3*\)\@!/ skip=/\n\n\zs\s/ end=/\n\n/ contains=pandocDefinitionBlockMark,pandocDefinitionBlockTerm,pandocCodeBlockInsideIndent,pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocNoFormatted,pandocStrikeout,pandocSubscript,pandocSuperscript,pandocFootnoteID,pandocReferenceURL,pandocReferenceLabel,pandocLaTeXMathBlock,pandocLaTeXInlineMath,pandocEscapedDollar,pandocAutomaticLink,pandocEmDash,pandocEnDash,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID
506-
syn match pandocDefinitionBlockTerm /^.*\n\(^\s*\n\)\=\(\s*[:~]\)\@=/ contained contains=pandocNoFormatted,pandocEmphasis,pandocStrong,pandocLaTeXInlineMath,pandocEscapedDollar,pandocFootnoteDef,pandocFootnoteBlock,pandocFootnoteID nextgroup=pandocDefinitionBlockMark
507-
call s:WithConceal('definition', 'syn match pandocDefinitionBlockMark /^\s*[:~]/ contained', 'conceal cchar='.s:cchars['definition'])
508-
endif
509-
" }}}2
510-
511-
" Special: {{{2
512-
513-
" New_lines: {{{3
514-
if g:pandoc#syntax#newlines == 1
515-
call s:WithConceal('newline', 'syn match pandocNewLine /\%(\%(\S\)\@<= \{2,}\|\\\)$/ display containedin=pandocEmphasis,pandocStrong,pandocStrongEmphasis,pandocStrongInEmphasis,pandocEmphasisInStrong', 'conceal cchar='.s:cchars['newline'])
516-
endif
517-
" }}}3
518-
519-
" Emdashes: {{{3
520-
if &encoding ==# 'utf-8'
521-
call s:WithConceal('emdashes', 'syn match pandocEllipses /\([^-]\)\@<=---\([^-]\)\@=/ display', 'conceal cchar=—')
522-
endif
523-
" }}}3
524-
525-
" Endashes: {{{3
526-
if &encoding ==# 'utf-8'
527-
call s:WithConceal('endashes', 'syn match pandocEllipses /\([^-]\)\@<=--\([^-]\)\@=/ display', 'conceal cchar=–')
528-
endif
529-
" }}}3
530-
531-
" Ellipses: {{{3
532-
if &encoding ==# 'utf-8'
533-
call s:WithConceal('ellipses', 'syn match pandocEllipses /\.\.\./ display', 'conceal cchar=…')
534-
endif
535-
" }}}3
536-
537-
" Quotes: {{{3
538-
if &encoding ==# 'utf-8'
539-
call s:WithConceal('quotes', 'syn match pandocBeginQuote /"\</ containedin=pandocEmphasis,pandocStrong,pandocListItem,pandocListItemContinuation,pandocUListItem display', 'conceal cchar=“')
540-
call s:WithConceal('quotes', 'syn match pandocEndQuote /\(\>[[:punct:]]*\)\@<="[[:blank:][:punct:]\n]\@=/ containedin=pandocEmphasis,pandocStrong,pandocUListItem,pandocListItem,pandocListItemContinuation display', 'conceal cchar=”')
541-
endif
542-
" }}}3
543-
544-
" Hrule: {{{3
545-
syn match pandocHRule /^\s*\([*\-_]\)\s*\%(\1\s*\)\{2,}$/ display
546-
" }}}3
547-
548-
" Backslashes: {{{3
549-
if g:pandoc#syntax#conceal#backslash == 1
550-
syn match pandocBackslash /\v\\@<!\\((re)?newcommand)@!/ containedin=ALLBUT,pandocCodeblock,pandocCodeBlockInsideIndent,pandocNoFormatted,pandocNoFormattedInEmphasis,pandocNoFormattedInStrong,pandocDelimitedCodeBlock,pandocLineBlock,pandocYAMLHeader conceal
551-
endif
552-
" }}}3
553-
554-
" &-escaped Special Characters: {{{3
555-
syn match pandocAmpersandEscape /\v\&(#\d+|#x\x+|[[:alnum:]]+)\;/ contains=NoSpell
556-
" }}}3
557-
558-
" YAML: {{{2
559-
try
560-
unlet! b:current_syntax
561-
syn include @YAML syntax/yaml.vim
562-
catch /E484/
563-
endtry
564-
syn region pandocYAMLHeader start=/\%(\%^\|\_^\s*\n\)\@<=\_^-\{3}\ze\n.\+/ end=/^\([-.]\)\1\{2}$/ keepend contains=@YAML containedin=TOP
565-
" }}}2
566-
567-
" }}}1
568-
569-
" Styling: {{{1
570-
hi link pandocOperator Operator
571-
572-
" override this for consistency
573-
hi pandocTitleBlock term=italic gui=italic
574-
hi link pandocTitleBlockTitle Directory
575-
hi link pandocAtxHeader Title
576-
hi link pandocAtxStart Operator
577-
hi link pandocSetexHeader Title
578-
hi link pandocHeaderAttr Comment
579-
hi link pandocHeaderID Identifier
580-
581-
hi link pandocLaTexSectionCmd texSection
582-
hi link pandocLaTeXDelimiter texDelimiter
583-
584-
hi link pandocHTMLComment Comment
585-
hi link pandocHTMLCommentStart Delimiter
586-
hi link pandocHTMLCommentEnd Delimiter
587-
hi link pandocBlockQuote Comment
588-
hi link pandocBlockQuoteMark Comment
589-
hi link pandocAmpersandEscape Special
590-
591-
" if the user sets g:pandoc#syntax#codeblocks#ignore to contain
592-
" a codeblock type, don't highlight it so that it remains Normal
593-
if index(g:pandoc#syntax#codeblocks#ignore, 'definition') == -1
594-
hi link pandocCodeBlockInsideIndent String
595-
endif
596-
597-
if index(g:pandoc#syntax#codeblocks#ignore, 'delimited') == -1
598-
hi link pandocDelimitedCodeBlock Special
599-
endif
600-
601-
hi link pandocDelimitedCodeBlockStart Delimiter
602-
hi link pandocDelimitedCodeBlockEnd Delimiter
603-
hi link pandocDelimitedCodeBlockLanguage Comment
604-
hi link pandocBlockQuoteinDelimitedCodeBlock pandocBlockQuote
605-
hi link pandocCodePre String
606-
607-
hi link pandocLineBlockDelimiter Delimiter
608-
609-
hi link pandocListItemBullet Operator
610-
hi link pandocUListItemBullet Operator
611-
hi link pandocListItemBulletId Identifier
612-
613-
hi link pandocReferenceLabel Label
614-
hi link pandocReferenceURL Underlined
615-
hi link pandocLinkTip Identifier
616-
hi link pandocImageIcon Operator
617-
618-
hi link pandocReferenceDefinition Operator
619-
hi link pandocReferenceDefinitionLabel Label
620-
hi link pandocReferenceDefinitionAddress Underlined
621-
hi link pandocReferenceDefinitionTip Identifier
622-
623-
hi link pandocAutomaticLink Underlined
624-
625-
hi link pandocDefinitionBlockTerm Identifier
626-
hi link pandocDefinitionBlockMark Operator
627-
628-
hi link pandocSimpleTableDelims Delimiter
629-
hi link pandocSimpleTableHeader pandocStrong
630-
hi link pandocTableMultilineHeader pandocStrong
631-
hi link pandocTableDelims Delimiter
632-
hi link pandocGridTableDelims Delimiter
633-
hi link pandocGridTableHeader Delimiter
634-
hi link pandocPipeTableDelims Delimiter
635-
hi link pandocPipeTableHeader Delimiter
636-
hi link pandocTableHeaderWord pandocStrong
637-
638-
hi link pandocAbbreviationHead Type
639-
hi link pandocAbbreviation Label
640-
hi link pandocAbbreviationTail Type
641-
hi link pandocAbbreviationSeparator Identifier
642-
hi link pandocAbbreviationDefinition Comment
643-
644-
hi link pandocFootnoteID Label
645-
hi link pandocFootnoteIDHead Type
646-
hi link pandocFootnoteIDTail Type
647-
hi link pandocFootnoteDef Comment
648-
hi link pandocFootnoteDefHead Type
649-
hi link pandocFootnoteDefTail Type
650-
hi link pandocFootnoteBlock Comment
651-
hi link pandocFootnoteBlockSeparator Operator
652-
653-
hi link pandocPCite Operator
654-
hi link pandocICite Operator
655-
hi link pandocCiteKey Label
656-
hi link pandocCiteAnchor Operator
657-
hi link pandocCiteLocator Operator
658-
659-
if g:pandoc#syntax#style#emphases == 1
660-
hi pandocEmphasis gui=italic cterm=italic
661-
hi pandocStrong gui=bold cterm=bold
662-
hi pandocStrongEmphasis gui=bold,italic cterm=bold,italic
663-
hi pandocStrongInEmphasis gui=bold,italic cterm=bold,italic
664-
hi pandocEmphasisInStrong gui=bold,italic cterm=bold,italic
665-
if !exists('s:hi_tail')
666-
let s:fg = '' " Vint can't figure ou these get set dynamically
667-
let s:bg = '' " so initialize them manually first
668-
for s:i in ['fg', 'bg']
669-
let s:tmp_val = synIDattr(synIDtrans(hlID('String')), s:i)
670-
let s:tmp_ui = has('gui_running') || (has('termguicolors') && &termguicolors) ? 'gui' : 'cterm'
671-
if !empty(s:tmp_val) && s:tmp_val != -1
672-
exe 'let s:'.s:i . ' = "'.s:tmp_ui.s:i.'='.s:tmp_val.'"'
673-
else
674-
exe 'let s:'.s:i . ' = ""'
675-
endif
676-
endfor
677-
let s:hi_tail = ' '.s:fg.' '.s:bg
678-
endif
679-
exe 'hi pandocNoFormattedInEmphasis gui=italic cterm=italic'.s:hi_tail
680-
exe 'hi pandocNoFormattedInStrong gui=bold cterm=bold'.s:hi_tail
681-
endif
682-
hi link pandocNoFormatted String
683-
hi link pandocNoFormattedAttrs Comment
684-
hi link pandocSubscriptMark Operator
685-
hi link pandocSuperscriptMark Operator
686-
hi link pandocStrikeoutMark Operator
687-
if g:pandoc#syntax#style#underline_special == 1
688-
hi pandocSubscript gui=underline cterm=underline
689-
hi pandocSuperscript gui=underline cterm=underline
690-
hi pandocStrikeout gui=underline cterm=underline
691-
endif
692-
hi link pandocNewLine Error
693-
hi link pandocHRule Delimiter
694-
695-
" }}}1
69621

69722
let b:current_syntax = 'pandoc'
698-
699-
syntax sync clear
700-
syntax sync minlines=1000

‎syntax/pandoc_commonmark.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
" Vim syntax file
2+
"
3+
" Language: CommonMark
4+
" Maintainer: Caleb Maclennan <caleb@alerque.com>
5+
6+
scriptencoding utf-8
7+
8+
syntax clear

‎syntax/pandoc_legacy.vim

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

0 commit comments

Comments
 (0)
Please sign in to comment.