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