From: Vsevolod Stakhov Date: Tue, 7 Sep 2021 15:35:02 +0000 (+0100) Subject: [Minor] Allow to get invisible content in `rspamadm mime ex` X-Git-Tag: 3.1~187 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1016ab74edfded80042be66bd37651672cb12808;p=thirdparty%2Frspamd.git [Minor] Allow to get invisible content in `rspamadm mime ex` --- diff --git a/lualib/rspamadm/mime.lua b/lualib/rspamadm/mime.lua index 68dd9e7606..0faeeca786 100644 --- a/lualib/rspamadm/mime.lua +++ b/lualib/rspamadm/mime.lua @@ -77,6 +77,8 @@ extract:flag "-p --part" :description "Show part info" extract:flag "-s --structure" :description "Show structure info (e.g. HTML tags)" +extract:flag "-i --invisible" + :description "Show invisible content for HTML parts" extract:option "-F --words-format" :description "Words format ('stem', 'norm', 'raw', 'full')" :argname("") @@ -432,6 +434,11 @@ local function extract_handler(opts) else -- opts.structure table.insert(out_elts[fname], tostring(part:get_content(how))) end + if opts.invisible then + local hc = part:get_html() + table.insert(out_elts[fname], string.format('invisible content: %s', + tostring(hc:get_invisible()))) + end end end