Support pandoc syntax for fenced code blocks

This commit is contained in:
Greg Anders
2019-10-10 14:32:14 -06:00
committed by Tim Pope
parent a2e123a288
commit 64689dfeae

View File

@@ -108,7 +108,7 @@ if main_syntax ==# 'markdown'
if has_key(s:done_include, matchstr(s:type,'[^.]*')) if has_key(s:done_include, matchstr(s:type,'[^.]*'))
continue continue
endif endif
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*````*\s*'.matchstr(s:type,'[^=]*').'\S\@!.*$" end="^\s*````*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*````*\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*````*\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends
let s:done_include[matchstr(s:type,'[^.]*')] = 1 let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor endfor
unlet! s:type unlet! s:type