From 1016ab74edfded80042be66bd37651672cb12808 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 7 Sep 2021 16:35:02 +0100 Subject: [PATCH] [Minor] Allow to get invisible content in `rspamadm mime ex` --- lualib/rspamadm/mime.lua | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.47.3