fix: 修复文档导入解析错误 (#570)
Some checks are pending
sync2gitee / repo-sync (push) Waiting to run
Typos Check / Spell Check with Typos (push) Waiting to run

This commit is contained in:
shaohuzhang1 2024-05-28 17:32:29 +08:00 committed by GitHub
parent d907dd3ac5
commit 22e192ed11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -37,14 +37,9 @@ def get_encoding(buffer):
class HTMLSplitHandle(BaseSplitHandle):
def support(self, file, get_buffer):
buffer = get_buffer(file)
file_name: str = file.name.lower()
if file_name.endswith(".html"):
return True
result = detect(buffer)
if result['encoding'] is not None and result['confidence'] is not None and result['encoding'] != 'ascii' and \
result['confidence'] > 0.5:
return True
return False
def handle(self, file, pattern_list: List, with_filter: bool, limit: int, get_buffer, save_image):