X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/43bc4bc18c1ea38f609413c8e9ab2995b8bf1a26..0a534a29f490adcd0612ff10a53b04109385404c:/ftplugin/markdown.vim diff --git a/ftplugin/markdown.vim b/ftplugin/markdown.vim index 14c24bc..5db57d8 100644 --- a/ftplugin/markdown.vim +++ b/ftplugin/markdown.vim @@ -640,7 +640,7 @@ function! s:MarkdownHighlightSources(force) " Look for code blocks in the current file let filetypes = {} for line in getline(1, '$') - let ft = matchstr(line, '```\zs[0-9A-Za-z_+-]*') + let ft = matchstr(line, '```\s*\zs[0-9A-Za-z_+-]*') if !empty(ft) && ft !~ '^\d*$' | let filetypes[ft] = 1 | endif endfor if !exists('b:mkd_known_filetypes') @@ -671,7 +671,7 @@ function! s:MarkdownHighlightSources(force) else let include = '@' . toupper(filetype) endif - let command = 'syntax region %s matchgroup=%s start="^\s*```%s$" matchgroup=%s end="\s*```$" keepend contains=%s%s' + let command = 'syntax region %s matchgroup=%s start="^\s*```\s*%s$" matchgroup=%s end="\s*```$" keepend contains=%s%s' execute printf(command, group, startgroup, ft, endgroup, include, has('conceal') && get(g:, 'vim_markdown_conceal', 1) ? ' concealends' : '') execute printf('syntax cluster mkdNonListItem add=%s', group)