4 Commits

Author SHA1 Message Date
Caleb Maclennan
c640842aaa Merge 151fdcd6e2 into f9f845f28f 2025-01-31 12:05:39 +03:00
Kyoh
f9f845f28f Allow colons after language identifiers in fenced code blocks 2024-12-21 12:05:17 -05:00
Caleb Maclennan
151fdcd6e2 Link trailing whitespace to Error color 2016-03-08 09:17:31 +02:00
Frans-Jan van Steenbeek
67338160b7 Add highlighting for trailing whitespace Double spaces are used in markdown to trigger a hard linebreak 2016-03-08 09:16:45 +02:00

View File

@@ -131,8 +131,8 @@ for s:type in g:markdown_fenced_languages
if has_key(s:done_include, matchstr(s:type,'[^.]*'))
continue
endif
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_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
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_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(`\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=[^[:space:]:]\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
exe 'syn region markdownHighlight_'.substitute(matchstr(s:type,'[^=]*$'),'\..*','','').' matchgroup=markdownCodeDelimiter start="^\s*\z(\~\{3,\}\)\s*\%({.\{-}\.\)\='.matchstr(s:type,'[^=]*').'}\=[^[:space:]:]\@!.*$" end="^\s*\z1\ze\s*$" keepend contains=@markdownHighlight_'.tr(matchstr(s:type,'[^=]*$'),'.','_') . s:concealends
let s:done_include[matchstr(s:type,'[^.]*')] = 1
endfor
unlet! s:type
@@ -145,6 +145,7 @@ if get(b:, 'markdown_yaml_head', get(g:, 'markdown_yaml_head', main_syntax ==# '
endif
syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]"
syn match markdownImplicitBreak "\s*\ \ $" containedin=ALL
syn match markdownError "\w\@<=_\w\@="
hi def link markdownH1 htmlH1
@@ -190,6 +191,7 @@ hi def link markdownStrikeDelimiter markdownStrike
hi def link markdownCodeDelimiter Delimiter
hi def link markdownEscape Special
hi def link markdownImplicitBreak Error
hi def link markdownError Error
let b:current_syntax = "markdown"