diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-24 09:35:18 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-11-25 12:35:06 +0000 |
commit | 9744716ba7e00681a7dbe7091cdb6ecd421ad32b (patch) | |
tree | b29fdbcfe6d2fc8bf2d300dc2e8a148e5f2a2b01 /lualib/lua_content/ical.lua | |
parent | 9374c19e58b3743f96b6b13e88d1366660cee696 (diff) | |
download | rspamd-9744716ba7e00681a7dbe7091cdb6ecd421ad32b.tar.gz rspamd-9744716ba7e00681a7dbe7091cdb6ecd421ad32b.zip |
[Project] Further content module work
Diffstat (limited to 'lualib/lua_content/ical.lua')
-rw-r--r-- | lualib/lua_content/ical.lua | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lualib/lua_content/ical.lua b/lualib/lua_content/ical.lua index 4f6b61919..c19723614 100644 --- a/lualib/lua_content/ical.lua +++ b/lualib/lua_content/ical.lua @@ -15,6 +15,7 @@ limitations under the License. ]]-- local l = require 'lpeg' +local rspamd_text = require "rspamd_text" local wsp = l.P" " local crlf = l.P"\r"^-1 * l.P"\n" @@ -25,7 +26,7 @@ local elt = name * ":" * wsp^0 * value * eol local exports = {} -local function ical_txt_values(input) +local function process_ical(input, _, _) local control={n='\n', r='\r'} local escaper = l.Ct((elt / function(_,b) return (b:gsub("\\(.)", control)) end)^1) @@ -35,13 +36,13 @@ local function ical_txt_values(input) return nil end - return table.concat(values, "\n") + return rspamd_text.fromtable(values, "\n") end --[[[ --- @function lua_ical.ical_txt_values(input) +-- @function lua_ical.process(input) -- Returns all values from ical as a plain text. Names are completely ignored. --]] -exports.ical_txt_values = ical_txt_values +exports.process = process_ical return exports
\ No newline at end of file |