From 6070e09834d64c558cf3de6f73c4819f000e9f4e Mon Sep 17 00:00:00 2001 From: Derick Phan Date: Thu, 26 Mar 2026 22:00:27 -0700 Subject: [PATCH] Fix navbar disappearing when saving customize form Browser textarea submissions convert \n to \r\n, causing the template comparison against DEFAULT_TEMPLATE to always fail. This saved the bare skeleton as a custom template, overriding the default navbar. Co-Authored-By: Claude Opus 4.6 --- handlers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/handlers.py b/handlers.py index 2034d3f..11e51e0 100644 --- a/handlers.py +++ b/handlers.py @@ -528,7 +528,7 @@ def handle_style_submit(body): template = body.get("template", [""])[0] name = body.get("site_name", ["tinyweb"])[0].strip() sharing = "1" if body.get("sharing_enabled") else "0" - set_setting("custom_template", template if template.strip() != DEFAULT_TEMPLATE.strip() else "") + set_setting("custom_template", template if template.strip().replace("\r\n", "\n") != DEFAULT_TEMPLATE.strip() else "") set_setting("site_name", name or "tinyweb") set_setting("sharing_enabled", sharing) return handle_style_form("Saved.")