From 657ab2e0efbe9446138b23e5185488dc9bd4d455 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Tue, 28 Apr 2020 14:30:24 +0200 Subject: lexers: make markdown white space rule less greedy This should give the code block rule a chance to actually match something, whereas before all leading white space was already consumed. Fix #823 --- lua/lexers/markdown.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/lexers/markdown.lua b/lua/lexers/markdown.lua index 3120beb..14b0cb1 100644 --- a/lua/lexers/markdown.lua +++ b/lua/lexers/markdown.lua @@ -8,7 +8,7 @@ local P, R, S = lpeg.P, lpeg.R, lpeg.S local M = {_NAME = 'markdown'} -- Whitespace. -local ws = token(l.WHITESPACE, l.space^1) +local ws = token(l.WHITESPACE, S(' \t')^1 + S('\v\r\n')^1) -- Block elements. local header = token('h6', l.starts_line('######') * l.nonnewline^0) + -- cgit v1.2.3