浏览代码

[Fix] Fix check plain text part

tags/1.4.0
AL 7 年前
父节点
当前提交
1a58c1cee6
共有 1 个文件被更改,包括 14 次插入13 次删除
  1. 14
    13
      src/plugins/lua/hfilter.lua

+ 14
- 13
src/plugins/lua/hfilter.lua 查看文件

@@ -255,7 +255,7 @@ local function hfilter(task)
plain_text_part = p
end
end
local hc = nil
if html_text_part then
local hc = html_text_part:get_html()
if hc then
@@ -279,18 +279,19 @@ local function hfilter(task)
end
end
end
elseif plain_text_part then
local url_len = plain_text_part:get_urls_length()
local plen = plain_text_part:get_length()

if plen > 0 and url_len > 0 then
local rel = url_len / plen
if rel > 0.8 then
task:insert_result('HFILTER_URL_ONLY', (rel - 0.8) * 5.0)
local lines = plain_text_part:get_lines_count()
if lines > 0 and lines < 2 then
task:insert_result('HFILTER_URL_ONELINE', 1.00)
end
end
end
if not hc and plain_text_part then
local url_len = plain_text_part:get_urls_length()
local plen = plain_text_part:get_length()

if plen > 0 and url_len > 0 then
local rel = url_len / plen
if rel > 0.8 then
task:insert_result('HFILTER_URL_ONLY', (rel - 0.8) * 5.0)
local lines = plain_text_part:get_lines_count()
if lines > 0 and lines < 2 then
task:insert_result('HFILTER_URL_ONELINE', 1.00)
end
end
end

正在加载...
取消
保存