mirror of
https://github.com/Sea-Haven-Industries/meal-order-manager.git
synced 2026-10-07 16:18:54 +00:00
Update src/server/generate_form.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
parent
57a6412811
commit
a9dcf28d09
1 changed files with 7 additions and 2 deletions
|
|
@ -38,8 +38,13 @@ def latest_menu() -> dict:
|
|||
|
||||
|
||||
def _json_for_script(value) -> str:
|
||||
"""Serialize for embedding in a <script> tag; escape </ to avoid early close."""
|
||||
return json.dumps(value, separators=(",", ":")).replace("</", "<\\/")
|
||||
"""Serialize for embedding in a <script> tag; escape < and JS line separators."""
|
||||
return (
|
||||
json.dumps(value, separators=(",", ":"))
|
||||
.replace("<", "\\u003c")
|
||||
.replace("\u2028", "\\u2028")
|
||||
.replace("\u2029", "\\u2029")
|
||||
)
|
||||
|
||||
|
||||
def generate_form(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue