Browse Source

[Minor] Do not autodetect html parts as text parts

tags/2.6
Vsevolod Stakhov 3 years ago
parent
commit
f722832e3a
1 changed files with 5 additions and 0 deletions
  1. 5
    0
      lualib/lua_magic/heuristics.lua

+ 5
- 0
lualib/lua_magic/heuristics.lua View File

@@ -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

Loading…
Cancel
Save