Convert editor panel <script> block to sexp wrapper

Separate JS content from HTML tag — pass JS body into
(script (raw! js)) so zero raw HTML tags remain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-28 13:27:48 +00:00
parent de3a6e4dde
commit f24292f99d

View File

@@ -1663,10 +1663,8 @@ def render_editor_panel(save_error: str | None = None, is_page: bool = False) ->
ecss=editor_css,
))
# Editor JS + init script — kept as raw HTML due to complex JS with quotes
parts.append(sexp('(script :src ejs)', ejs=editor_js))
parts.append(
"<script>\n"
# Editor JS + init script
init_js = (
"(function() {\n"
" function applyEditorFontSize() {\n"
" document.documentElement.style.fontSize = '62.5%';\n"
@@ -1796,8 +1794,11 @@ def render_editor_panel(save_error: str | None = None, is_page: bool = False) ->
" }, 50);\n"
" }\n"
"})();\n"
"</script>"
)
parts.append(sexp(
'(<> (script :src ejs) (script (raw! js)))',
ejs=editor_js, js=init_js,
))
return "".join(parts)