mirror of
https://github.com/open-webui/open-webui.git
synced 2026-12-01 17:32:52 -05: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:
1 parent
b39abad5c2
commit
59ea3b7c2c
1 file changed
+1
-1
@@ -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':
|
||||
|
||||
Reference in new issue
Block a user