]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Ical: Fix identation grammar
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 29 Jun 2020 16:17:23 +0000 (17:17 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 29 Jun 2020 16:17:23 +0000 (17:17 +0100)
lualib/lua_content/ical.lua

index bb2f52771a9aa2b22afd297320817e6f4fa118c8..ed9a87cc52a9951992d9d494718311b3bd5f8a17 100644 (file)
@@ -22,12 +22,12 @@ local ical_grammar
 
 local function gen_grammar()
   if not ical_grammar then
-    local wsp = l.P" "
+    local wsp = l.S(" \t\v\f")
     local crlf = l.P"\r"^-1 * l.P"\n"
     local eol = (crlf * #crlf) + (crlf - (crlf^-1 * wsp))
     local name = l.C((l.P(1) - (l.P":"))^1) / function(v) return (v:gsub("[\n\r]+%s","")) end
     local value = l.C((l.P(1) - eol)^0) / function(v) return (v:gsub("[\n\r]+%s","")) end
-    ical_grammar = name * ":" * wsp^0 * value * eol
+    ical_grammar = name * ":" * wsp^0 * value * eol^-1
   end
 
   return ical_grammar