Skip to content

Commit 3816c30

Browse files
committed
Add support for Pandoc raw_attribute syntax
In addition to the ```lang syntax for beginning a fenced code block with syntax highlighting, support the ```{=lang} syntax used by Pandoc to include raw code of that language (e.g. raw HTML code if the Markdown file will be converted to HTML). https://pandoc.org/MANUAL.html#extension-raw_attribute
1 parent b64a485 commit 3816c30

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

syntax/markdown.vim

+2-2
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ if main_syntax ==# 'markdown'
119119
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
120120
continue
121121
endif
122-
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)*\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends
123-
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)*\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends
122+
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)*\s*\%({.\{-}\.\)\={\==\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends
123+
exe 'syn region markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)*\s*\%({.\{-}\.\)\={\==\='.matchstr(s:type,'[^=]*').'}\=\S\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight'.substitute(matchstr(s:type,'[^=]*$'),'\.','','g') . s:concealends
124124
let s:done_include[matchstr(s:type,'[^.]*')] = 1
125125
endfor
126126
unlet! s:type

0 commit comments

Comments
 (0)