Add markdown syntax support for indented code blocks.

This commit is contained in:
Rane Brown
2020-01-03 07:10:02 -07:00
parent 59e1229da6
commit 3ec0c9cd91
4 changed files with 36 additions and 12 deletions

View File

@ -79,9 +79,10 @@ let s:markdown_syntax.number_types = ['1.']
let s:markdown_syntax.list_markers = ['-', '*', '+', '1.']
let s:markdown_syntax.rxListDefine = '::\%(\s\|$\)'
" Preformatted text
" Preformatted text (code blocks)
let s:markdown_syntax.rxPreStart = '\%(`\{3,}\|\~\{3,}\)'
let s:markdown_syntax.rxPreEnd = '\%(`\{3,}\|\~\{3,}\)'
let s:markdown_syntax.rxIndentedCodeBlock = '^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+\(^\s*\n\)'
" Math block
let s:markdown_syntax.rxMathStart = '\$\$'

View File

@ -190,7 +190,9 @@ syntax match VimwikiTableRow /^\s*|.\+|\s*$/
\ VimwikiEqInT,
\ @Spell
" indented code blocks https://github.github.com/gfm/#indented-code-blocks
execute 'syntax match VimwikiIndentedCodeBlock /' . vimwiki#vars#get_syntaxlocal('rxIndentedCodeBlock') . '/'
hi def link VimwikiIndentedCodeBlock VimwikiPre
" syntax group highlighting
hi def link VimwikiImage VimwikiLink