From 1bec9ed48681b697c438397a8f8ffe08f586505d Mon Sep 17 00:00:00 2001 From: Ben Williams Date: Tue, 12 May 2009 13:12:15 -0400 Subject: [PATCH 1/1] Link improvements from Marc Hartstein. --- mkd.vim | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) 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" -- 2.39.5