From 0ec088ea2def1bae5c51b82d0683ebb0406da083 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sat, 16 Jun 2018 21:28:43 -0400 Subject: Fixed incorrect highlighting of indented markdown lists. They were being identified as blockcode. --- lexlua/markdown.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lexlua/markdown.lua') diff --git a/lexlua/markdown.lua b/lexlua/markdown.lua index 2622a11d7..eb1327c75 100644 --- a/lexlua/markdown.lua +++ b/lexlua/markdown.lua @@ -33,6 +33,11 @@ lex:add_rule('blockquote', return (e or #input) + 1 end))) +lex:add_rule('list', token('list', lexer.starts_line(S(' \t')^0 * (S('*+-') + + R('09')^1 * '.')) * + S(' \t'))) +lex:add_style('list', lexer.STYLE_CONSTANT) + lex:add_rule('blockcode', token('code', lexer.starts_line(P(' ')^4 + P('\t')) * -P('<') * lexer.nonnewline^0 * lexer.newline^-1)) @@ -51,11 +56,6 @@ lex:add_rule('hr', end))) lex:add_style('hr', 'back:$(color.black),eolfilled') -lex:add_rule('list', token('list', lexer.starts_line(S(' \t')^0 * (S('*+-') + - R('09')^1 * '.')) * - S(' \t'))) -lex:add_style('list', lexer.STYLE_CONSTANT) - -- Whitespace. local ws = token(lexer.WHITESPACE, S(' \t')^1 + S('\v\r\n')^1) lex:add_rule('whitespace', ws) -- cgit v1.2.3