mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-05 02:41:34 +00:00
fix: backslashes in uploaded HTML files turn into line breaks or break the upload (#31450)
With the default content extraction engine, backslashes in an uploaded .html or .htm file were read as escape sequences. A path like C:\new\table was saved with a line break and a tab in it, and a page containing C:\Users failed to upload with a 'unicodeescape' codec error. HTML files are now read the same way as .txt and .md uploads, so the saved text matches the page. Fixes #31440
This commit is contained in:
parent
b39abad5c2
commit
59ea3b7c2c
1 changed files with 1 additions and 1 deletions
|
|
@ -745,7 +745,7 @@ class Loader:
|
|||
)
|
||||
loader = TextLoader(file_path, encoding=self._detect_text_encoding(file_path))
|
||||
elif file_ext in ['htm', 'html']:
|
||||
loader = HTMLLoader(file_path, encoding='unicode_escape')
|
||||
loader = HTMLLoader(file_path, encoding=self._detect_text_encoding(file_path))
|
||||
elif file_ext == 'md':
|
||||
loader = TextLoader(file_path, encoding=self._detect_text_encoding(file_path))
|
||||
elif file_content_type == 'application/epub+zip':
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue