From c6d7597da30f776206b64d6bbd98cdf914c090b2 Mon Sep 17 00:00:00 2001 From: Shane Pearman Date: Thu, 29 Jun 2017 17:19:54 -0700 Subject: [PATCH] Change mkdRule match syntax to be more liberal Consider any line beginning with 3 or more of '*', '-', or '_' with possible spaces before and between, possibly followed by zero or more of the previously matched symbols or spaces to be a horizontal rule. --- syntax/markdown.vim | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/syntax/markdown.vim b/syntax/markdown.vim index 43cb898..008a6d8 100644 --- a/syntax/markdown.vim +++ b/syntax/markdown.vim @@ -108,11 +108,9 @@ syn match mkdCode /^\s*\n\(\(\s\{4,}[^ ]\|\t\+[^\t]\).*\n\)\+/ containe syn match mkdListItem /^\s*\%([-*+]\|\d\+\.\)\ze\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}-$/ -syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_$/ -syn match mkdRule /^\s*-\{3,}$/ -syn match mkdRule /^\s*\*\{3,5}$/ +syn match mkdRule /^\s*\*\s\{0,1}\*\s\{0,1}\*\(\*\|\s\)*$/ +syn match mkdRule /^\s*-\s\{0,1}-\s\{0,1}-\(-\|\s\)*$/ +syn match mkdRule /^\s*_\s\{0,1}_\s\{0,1}_\(_\|\s\)*$/ " YAML frontmatter if get(g:, 'vim_markdown_frontmatter', 0) -- 2.39.5