From: Ben Williams Date: Tue, 12 May 2009 17:12:15 +0000 (-0400) Subject: Link improvements from Marc Hartstein. X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/1bec9ed48681b697c438397a8f8ffe08f586505d Link improvements from Marc Hartstein. --- diff --git a/mkd.vim b/mkd.vim index 3fe2a40..d6e63a4 100644 --- a/mkd.vim +++ b/mkd.vim @@ -7,7 +7,6 @@ " 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: Do something appropriate with image syntax " TODO: Handle stuff contained within stuff (e.g. headings within blockquotes) @@ -41,9 +40,19 @@ syn region htmlBold start=/\\\@) +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 +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+'+ end=+'+ contained +syn region mkdLinkTitle matchgroup=mkdDelimiter start=+(+ end=+)+ contained "define Markdown groups syn match mkdLineContinue ".$" contained @@ -80,6 +89,14 @@ HtmlHiLink mkdLineContinue Comment HtmlHiLink mkdListItem Identifier HtmlHiLink mkdRule Identifier HtmlHiLink mkdLineBreak Todo +HtmlHiLink mkdLink htmlLink +HtmlHiLink mkdURL htmlString +HtmlHiLink mkdID Identifier +HtmlHiLink mkdLinkDef mkdID +HtmlHiLink mkdLinkDefTarget mkdURL +HtmlHiLink mkdLinkTitle htmlString + +HtmlHiLink mkdDelimiter Delimiter let b:current_syntax = "mkd"