X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/71f171736fb549352c04e19e27632a230964dce2..d12befde9cfc3d83c04c484107f2d0ac5dc40e45:/syntax/mkd.vim diff --git a/syntax/mkd.vim b/syntax/mkd.vim index e10bbc3..60a675d 100644 --- a/syntax/mkd.vim +++ b/syntax/mkd.vim @@ -2,11 +2,7 @@ " Language: Markdown " Maintainer: Ben Williams " URL: http://plasticboy.com/markdown-vim-mode/ -" Version: 9 -" Last Change: 2009 May 18 " Remark: Uses HTML syntax file -" Remark: I don't do anything with angle brackets (<>) because that would too easily -" easily conflict with HTML syntax " TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) @@ -51,12 +47,16 @@ syn region mkdFootnotes matchgroup=mkdDelimiter start="\[^" end="\]" syn region mkdID matchgroup=mkdDelimiter start="\[" end="\]" contained oneline syn region mkdURL matchgroup=mkdDelimiter start="(" end=")" contained oneline syn region mkdLink matchgroup=mkdDelimiter start="\\\@ ]*>\)\@=" end=">" + " Link definitions: [id]: URL (Optional Title) -" TODO handle automatic links without colliding with htmlTag () syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite syn region mkdLinkDefTarget start="<\?\zs\S" excludenl end="\ze[>[:space:]\n]" contained nextgroup=mkdLinkTitle,mkdLinkDef skipwhite skipnl oneline syn region mkdLinkTitle matchgroup=mkdDelimiter start=+"+ end=+"+ contained @@ -70,6 +70,8 @@ syn region mkdBlockquote start=/^\s*>/ end=/$/ contains=mkdL syn region mkdCode start=/\(\([^\\]\|^\)\\\)\@]*>" end="" syn region mkdCode start="]*>" end="" syn region mkdFootnote start="\[^" end="\]" @@ -94,7 +96,18 @@ syn region htmlH6 start="^\s*######" end="\($\|#\+\)" contain syn match htmlH1 /^.\+\n=\+$/ contains=@Spell syn match htmlH2 /^.\+\n-\+$/ contains=@Spell -syn cluster mkdNonListItem contains=htmlItalic,htmlBold,htmlBoldItalic,mkdFootnotes,mkdID,mkdURL,mkdLink,mkdLinkDef,mkdLineBreak,mkdBlockquote,mkdCode,mkdIndentCode,mkdListItem,mkdRule,htmlH1,htmlH2,htmlH3,htmlH4,htmlH5,htmlH6 +if get(g:, 'vim_markdown_math', 0) + syn region mkdMath matchgroup=mkdDelimiter start="\\\@ + let b:current_syntax = "mkd" delcommand HtmlHiLink