From 5d98d6b22bd9848748ec9fd7780d056ff63c2ddd Mon Sep 17 00:00:00 2001 From: Hiroshi Shirosaki Date: Thu, 21 Jan 2016 11:41:57 +0900 Subject: [PATCH 1/1] Fix list item highlight after line break --- syntax/markdown.vim | 5 +++-- test/syntax.vader | 8 ++++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index b59bc59..778e818 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -97,7 +97,8 @@ syn region mkdFootnote start="\[^" end="\]" syn match mkdCode /^\s*\n\(\(\s\{8,}[^ ]\|\t\t\+[^\t]\).*\n\)\+/ syn match mkdCode /\%^\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ contained -syn region mkdListItemLine matchgroup=mkdListItem start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" contains=@mkdNonListItem,@Spell +syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\s\+/ contained +syn region mkdListItemLine start="^\s*\%([-*+]\|\d\+\.\)\s\+" end="$" oneline contains=@mkdNonListItem,mkdListItem,@Spell syn region mkdNonListItemBlock start="\(\%^\(\s*\([-*+]\|\d\+\.\)\s\+\)\@!\|\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}-$/ @@ -117,7 +118,7 @@ if get(g:, 'vim_markdown_math', 0) syn region mkdMath matchgroup=mkdDelimiter start="\\\@ are not marked as htmlError in lists): AssertNotEqual SyntaxOf('&'), 'htmlError' AssertNotEqual SyntaxOf('>'), 'htmlError' +Given markdown; +1. a +2. b + +Execute (list after line break): + AssertEqual SyntaxOf('1'), 'mkdListItem' + AssertEqual SyntaxOf('2'), 'mkdListItem' + # HTML Given markdown; -- 2.39.5