aboutsummaryrefslogtreecommitdiffhomepage
path: root/lexlua/markdown.lua
diff options
context:
space:
mode:
authormitchell <unknown>2018-10-07 13:49:00 -0400
committermitchell <unknown>2018-10-07 13:49:00 -0400
commit8d388170c11941d3ee3167dc503950a198c52c55 (patch)
tree69bfc293351a66d2126f585b958f8bd13f0f9a80 /lexlua/markdown.lua
parent3b8a22c3a9cfe053856af925890cd60e775d497b (diff)
downloadscintilla-mirror-8d388170c11941d3ee3167dc503950a198c52c55.tar.gz
lexlua: Handle CR+LF in horizontal rules for Markdown.
Diffstat (limited to 'lexlua/markdown.lua')
-rw-r--r--lexlua/markdown.lua4
1 files changed, 2 insertions, 2 deletions
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')