Skip to content

Commit

Permalink
[Minor] Do not autodetect html parts as text parts
Browse files Browse the repository at this point in the history
  • Loading branch information
vstakhov committed Jul 16, 2020
1 parent 4fb77a8 commit f722832
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lualib/lua_magic/heuristics.lua
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f722832

Please sign in to comment.