fix: 修复文档导入解析错误 (#570)
This commit is contained in:
parent
d907dd3ac5
commit
22e192ed11
@ -37,14 +37,9 @@ def get_encoding(buffer):
|
|||||||
|
|
||||||
class HTMLSplitHandle(BaseSplitHandle):
|
class HTMLSplitHandle(BaseSplitHandle):
|
||||||
def support(self, file, get_buffer):
|
def support(self, file, get_buffer):
|
||||||
buffer = get_buffer(file)
|
|
||||||
file_name: str = file.name.lower()
|
file_name: str = file.name.lower()
|
||||||
if file_name.endswith(".html"):
|
if file_name.endswith(".html"):
|
||||||
return True
|
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
|
return False
|
||||||
|
|
||||||
def handle(self, file, pattern_list: List, with_filter: bool, limit: int, get_buffer, save_image):
|
def handle(self, file, pattern_list: List, with_filter: bool, limit: int, get_buffer, save_image):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user