open-webui/backend/open_webui
Classic298 1bfa59acbd
fix: keep HTML entities in extracted document text (#29736)
Uploading a file whose text contains literal HTML entities stored a rewritten copy of it: ` ` became a non-breaking space, `>` became `>`, and ` ` was decoded twice down to a bare non-breaking space. That stored text is what gets indexed and what the model reads, so notes, specs and source files reached the model differing from the file that was uploaded.

Every loaded document goes through `ftfy.fix_text`, which is there to repair mojibake left by the encoding-detection fallback. Its default configuration also decodes HTML entities, per line and sticky forward: entities are decoded on every line up to the first line holding a literal `<`, then left alone for the rest of the document. The same escape therefore survives or vanishes depending on where it sits in the file. This disables that one behaviour and leaves every other ftfy repair in place.

Text from a third-party extraction engine that returns escaped output now keeps those escapes. Guessing whether an escape is markup or content is the bug being fixed.

Fixes #29732
2026-09-06 15:13:45 -04:00
..
data refac: mv backend files to /open_webui dir 2024-09-04 16:54:48 +02:00
internal refac 2026-08-30 21:36:17 -04:00
migrations chore: format 2026-08-25 16:53:53 -04:00
models refac 2026-09-04 18:31:59 -04:00
retrieval fix: keep HTML entities in extracted document text (#29736) 2026-09-06 15:13:45 -04:00
routers refac 2026-09-04 22:56:00 -04:00
socket perf: stop scanning every socket.io payload for binary data (#28180) 2026-08-31 01:22:06 -04:00
static refac 2026-07-27 19:39:36 -04:00
storage refac 2026-07-31 17:41:14 -04:00
tools refac: run the built-in file grep off the event loop (#29621) 2026-09-04 11:41:06 -04:00
utils fix: surface upstream errors on arena models instead of crashing (#29662) 2026-09-04 17:17:02 -04:00
__init__.py perf: allow disabling websocket per-message-deflate (#28613) 2026-08-24 18:46:07 -04:00
alembic.ini fix: Alembic CLI commands from failing 2025-08-15 04:17:47 -04:00
config.py refac 2026-09-04 19:12:41 -04:00
constants.py refac 2026-08-29 16:14:32 -04:00
env.py fix: bound extracted document metadata by the upload size limit by default (#29025) 2026-08-25 15:50:27 -04:00
events.py refac 2026-08-16 23:21:00 -07:00
functions.py fix: honor bypass_system_prompt on the pipe route (#28739) 2026-08-19 11:08:02 -07:00
main.py refac 2026-09-04 19:12:41 -04:00
tasks.py fix: stopping a response across instances on Redis Cluster (#29165) 2026-08-29 15:00:52 -04:00