mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: 修复文档导入解析错误 (#570)
This commit is contained in:
parent
d907dd3ac5
commit
22e192ed11
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Reference in New Issue