From f722832e3aba64438a7ca132a56db00bb182e2f6 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Thu, 16 Jul 2020 16:14:22 +0100 Subject: [PATCH] [Minor] Do not autodetect html parts as text parts --- lualib/lua_magic/heuristics.lua | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 82c2fa4bd..8c63cce72 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -393,6 +393,7 @@ exports.text_part_heuristic = function(part, log_obj, _) end local content = part:get_content() + local mtype,msubtype = part:get_type() local clen = #content local is_text @@ -433,6 +434,10 @@ exports.text_part_heuristic = function(part, log_obj, _) end end + if mtype == 'text' and (msubtype == 'html' or msubtype == 'htm') then + return 'html',21 + end + return 'txt',40 end end -- 2.39.5