From: Hiroshi Shirosaki Date: Tue, 5 Jan 2016 09:36:50 +0000 (+0900) Subject: Fix link highlight in parenthesis X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/65a5391f576066792cf7c22d3e1b8810619ae119?hp=c45a152fcb95075120ad7f99fad08b6b1b720299 Fix link highlight in parenthesis --- diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 5ee9cc4..c9e4772 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -53,8 +53,13 @@ syn region mkdLink matchgroup=mkdDelimiter start="\\\@ ]*>\)\@=" end=">" +execute 'syn region mkdInlineURL matchgroup=mkdDelimiter start="\\\@ ]*>\)\@=" end=">"' " Link definitions: [id]: URL (Optional Title) syn region mkdLinkDef matchgroup=mkdDelimiter start="^ \{,3}\zs\[" end="]:" oneline nextgroup=mkdLinkDefTarget skipwhite diff --git a/test/syntax.vader b/test/syntax.vader index 8b9b21a..e56edcd 100644 --- a/test/syntax.vader +++ b/test/syntax.vader @@ -137,6 +137,16 @@ Given markdown; Execute (autolinks can be backslash escaped): AssertNotEqual SyntaxOf('<'), 'mkdDelimiter' +Given markdown; +a (http://b) c + +Execute (autolink in parenthesis): + AssertNotEqual SyntaxOf('a'), 'mkdInlineURL' + AssertEqual SyntaxOf('('), 'mkdDelimiter' + AssertEqual SyntaxOf('b'), 'mkdInlineURL' + AssertEqual SyntaxOf(')'), 'mkdDelimiter' + AssertNotEqual SyntaxOf('c'), 'mkdInlineURL' + # Code Blocks Given markdown;