From 4d1f1eabf0270c101da99940b4b83d765a7bb79b Mon Sep 17 00:00:00 2001 From: Open WebUI <15+open-webui@noreply.sakamoto.best> Date: Thu, 3 Sep 2026 16:24:52 +0000 Subject: [PATCH] Add \n conversion support for ads too --- config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config.py b/config.py index ce49033..33c163e 100644 --- a/config.py +++ b/config.py @@ -43,12 +43,13 @@ class Config: return default_replies def _load_ads(self, file_path: str = "storage/ads.txt"): - """Load ad content from file (single ad, no multi-line conversion needed)""" + """Load ad content from file (can be multi-line with actual line breaks or \\n)""" try: with open(file_path, "r", encoding="utf-8") as f: ad_content = f.read().strip() if ad_content: - return ad_content + # Convert literal \n to actual newlines for ads too + return ad_content.replace("\\n", "\n") return None except FileNotFoundError: logger.warning(f"Ad file {file_path} not found")