aboutsummaryrefslogtreecommitdiff
path: root/lua/lexers/markdown.lua
diff options
context:
space:
mode:
authorMarc André Tanner <mat@brain-dump.org>2020-04-28 14:30:24 +0200
committerMarc André Tanner <mat@brain-dump.org>2020-04-28 14:33:48 +0200
commit657ab2e0efbe9446138b23e5185488dc9bd4d455 (patch)
treefb43100a8552d6e6600c483e02b590c79c9cc162 /lua/lexers/markdown.lua
parentaae0b3848a77138667113e55513f3d0014eae25e (diff)
downloadvis-657ab2e0efbe9446138b23e5185488dc9bd4d455.tar.gz
vis-657ab2e0efbe9446138b23e5185488dc9bd4d455.tar.xz
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
Diffstat (limited to 'lua/lexers/markdown.lua')
-rw-r--r--lua/lexers/markdown.lua2
1 files changed, 1 insertions, 1 deletions
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) +