瀏覽代碼

[Minor] Lua_magic: Improve html detection heuristic

tags/2.7
Vsevolod Stakhov 3 年之前
父節點
當前提交
63869b7d7b
共有 1 個檔案被更改,包括 7 行新增0 行删除
  1. 7
    0
      lualib/lua_magic/heuristics.lua

+ 7
- 0
lualib/lua_magic/heuristics.lua 查看文件

@@ -435,10 +435,17 @@ exports.text_part_heuristic = function(part, log_obj, _)
end
end

-- Content type stuff
if (mtype == 'text' or mtype == 'application') and (msubtype == 'html' or msubtype == 'xhtml+xml') then
return 'html',21
end

-- Extension stuff
local fname = part:get_filename()
if fname and fname:match('html?$') then
return 'html',21
end

return 'txt',40
end
end

Loading…
取消
儲存