From 8d388170c11941d3ee3167dc503950a198c52c55 Mon Sep 17 00:00:00 2001 From: mitchell Date: Sun, 7 Oct 2018 13:49:00 -0400 Subject: lexlua: Handle CR+LF in horizontal rules for Markdown. --- lexlua/markdown.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lexlua') diff --git a/lexlua/markdown.lua b/lexlua/markdown.lua index eb1327c75..cc56327c6 100644 --- a/lexlua/markdown.lua +++ b/lexlua/markdown.lua @@ -47,12 +47,12 @@ lex:add_rule('hr', token('hr', lpeg.Cmt(lexer.starts_line(S(' \t')^0 * lpeg.C(S('*-_'))), function(input, index, c) - local line = input:match('[^\n]*', index) + local line = input:match('[^\r\n]*', index) line = line:gsub('[ \t]', '') if line:find('[^'..c..']') or #line < 2 then return nil end - return (input:find('\n', index) or #input) + 1 + return (input:find('\r?\n', index) or #input) + 1 end))) lex:add_style('hr', 'back:$(color.black),eolfilled') -- cgit v1.2.3