Fix custom template rendering and ensure customize page uses default layout

Add use_default parameter to wrap_page/respond so the customize page
always renders with the default template (preventing a broken custom
template from locking out the editor). Also fix the stored custom
template: add <!DOCTYPE html> to prevent quirks mode and remove
newlines inside CSS cursor data URIs that caused CSS parse errors.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Derick Phan 2026-03-26 09:45:42 -07:00
parent 8741c2fffb
commit b17988fc95
No known key found for this signature in database
3 changed files with 10 additions and 6 deletions

View file

@ -30,8 +30,11 @@ def _default_template():
)
def wrap_page(body_html):
template = get_setting("custom_template") or _default_template()
if "{{content}}" not in template:
def wrap_page(body_html, use_default=False):
if use_default:
template = _default_template()
else:
template = get_setting("custom_template") or _default_template()
if "{{content}}" not in template:
template = _default_template()
return template.replace("{{content}}", body_html)