From 5a689fb526a45a370408381cdf3b437e2d5fef4c Mon Sep 17 00:00:00 2001 From: takenoko Date: Sat, 21 Apr 2018 23:43:36 +0900 Subject: [PATCH 1/2] Add syntaxes fenced TeX with dollar --- syntax/markdown.vim | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index a069746..33c62d0 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -144,6 +144,14 @@ if get(b:, 'markdown_yaml_head', get(g:, 'markdown_yaml_head', main_syntax ==# ' syn region markdownYamlHead start="\%^---$" end="^\%(---\|\.\.\.\)\s*$" keepend contains=@markdownYamlTop,@Spell endif +if g:markdown_fenced_tex + syn include syntax/tex.vim + syn region markdownHighlighttex matchgroup=markdownCodeDelimiter start="\\\\(\ze[^ \n]" end="[^ \n]\zs\\\\)" keepend contains=@texMathZoneGroup + syn region markdownHighlighttex matchgroup=markdownCodeDelimiter start="\\\\\[" end="\\\\\]" keepend contains=@texMathZoneGroup + syn region markdownHighlighttex matchgroup=markdownCodeDelimiter start="\$\ze[^ \n]" end="[^ \n]\zs\$" keepend contains=@texMathZoneGroup + syn region markdownHighlighttex matchgroup=markdownCodeDelimiter start="\$\$" end="\$\$" keepend contains=@texMathZoneGroup +endif + syn match markdownEscape "\\[][\\`*_{}()<>#+.!-]" syn match markdownError "\w\@<=_\w\@=" From 0fedf6c6677501045f1014070febe702104415d5 Mon Sep 17 00:00:00 2001 From: takenoko Date: Sun, 22 Apr 2018 21:33:10 +0900 Subject: [PATCH 2/2] Fix getting global variable --- syntax/markdown.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 33c62d0..935afb2 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -144,7 +144,7 @@ if get(b:, 'markdown_yaml_head', get(g:, 'markdown_yaml_head', main_syntax ==# ' syn region markdownYamlHead start="\%^---$" end="^\%(---\|\.\.\.\)\s*$" keepend contains=@markdownYamlTop,@Spell endif -if g:markdown_fenced_tex +if get(g:, 'markdown_fenced_tex', 0) syn include syntax/tex.vim syn region markdownHighlighttex matchgroup=markdownCodeDelimiter start="\\\\(\ze[^ \n]" end="[^ \n]\zs\\\\)" keepend contains=@texMathZoneGroup syn region markdownHighlighttex matchgroup=markdownCodeDelimiter start="\\\\\[" end="\\\\\]" keepend contains=@texMathZoneGroup