From: Hiroshi Shirosaki Date: Fri, 8 Jan 2016 06:25:40 +0000 (+0900) Subject: Fix `&` and `>` are marked as htmlError in lists X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/ffba73263b1fb5291390bb9b2bf313552147f922?hp=-c Fix `&` and `>` are marked as htmlError in lists Fix #214 --- ffba73263b1fb5291390bb9b2bf313552147f922 diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 72e59e2..0e147a3 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -82,8 +82,7 @@ syn region mkdCode start="]*>" end="" syn region mkdFootnote start="\[^" end="\]" syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ syn match mkdIndentCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained -syn match mkdListItem "^\s*[-*+]\s\+" -syn match mkdListItem "^\s*\d\+\.\s\+" +syn region mkdListItemLine matchgroup=mkdListItem start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" contains=@mkdNonListItem,@Spell syn region mkdNonListItemBlock start="\n\(\_^\_$\|\s\{4,}[^ ]\|\t+[^\t]\)\@!" end="^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@=" contains=@mkdNonListItem,@Spell syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*$/ syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-$/ diff --git a/test/syntax.vader b/test/syntax.vader index f3bbf63..9334cab 100644 --- a/test/syntax.vader +++ b/test/syntax.vader @@ -292,3 +292,15 @@ ddd Execute (header title starts with #): AssertEqual SyntaxOf('a'), 'htmlH1' AssertEqual SyntaxOf('b'), 'htmlH2' + +# List + +Given markdown; +- a & b +1. c > d + +Execute (& and > are not marked as htmlError in lists): + AssertEqual SyntaxOf('-'), 'mkdListItem' + AssertEqual SyntaxOf('1.'), 'mkdListItem' + AssertNotEqual SyntaxOf('&'), 'htmlError' + AssertNotEqual SyntaxOf('>'), 'htmlError'