diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-29 17:53:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-07-29 17:53:01 +0100 |
commit | 49e5514eaf91f70205374c55ed7383a6b9f8a12d (patch) | |
tree | 90513351c1e6cbb8f69321f3ccaffdba64564a58 /lualib | |
parent | b369727b44bf851981ca88b764e9429428154b72 (diff) | |
download | rspamd-49e5514eaf91f70205374c55ed7383a6b9f8a12d.tar.gz rspamd-49e5514eaf91f70205374c55ed7383a6b9f8a12d.zip |
[Minor] More tags output fixes
Diffstat (limited to 'lualib')
-rw-r--r-- | lualib/rspamadm/mime.lua | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/lualib/rspamadm/mime.lua b/lualib/rspamadm/mime.lua index a92c8c01c..9dc387ef0 100644 --- a/lualib/rspamadm/mime.lua +++ b/lualib/rspamadm/mime.lua @@ -386,28 +386,38 @@ local function extract_handler(opts) local hc = part:get_html() local res = {} process_func = function(elt) - return rspamd_logger.slog("%s", elt) + local fun = require "fun" + if type(elt) == 'table' then + return table.concat(fun.totable( + fun.map( + function(t) + return rspamd_logger.slog("%s", t) + end, + elt)), '\n') + else + return rspamd_logger.slog("%s", elt) + end end hc:foreach_tag('any', function(tag) - local elt = {} - local ex = tag:get_extra() - elt.tag = tag:get_type() - if ex then - elt.extra = ex - end - local content = tag:get_content() - if content then - elt.content = tostring(content) - end - local style = tag:get_style() - if style then - elt.style = style - end - table.insert(res, elt) + local elt = {} + local ex = tag:get_extra() + elt.tag = tag:get_type() + if ex then + elt.extra = ex + end + local content = tag:get_content() + if content then + elt.content = tostring(content) + end + local style = tag:get_style() + if style then + elt.style = style + end + table.insert(res, elt) end) table.insert(out_elts[fname], res) - else + else -- opts.structure table.insert(out_elts[fname], tostring(part:get_content(how))) end end |