fix: JS syntax error on pages with special characters in content
x-data editor() arguments used manual |e escaping with single quotes. Page content containing newlines, quotes or backslashes broke the JavaScript string literal. Now uses |tojson filter for all fields (proper JSON escaping).
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="page-editor-wrapper" x-data="editor('{{ page.id }}', '{{ page.title|e }}', '{{ page.content_format }}', '{{ page.content|e }}', {{ page_favorited | tojson }})" x-init="init()">
|
||||
<div class="page-editor-wrapper" x-data="editor({{ page.id }}, {{ page.title | tojson }}, {{ page.content_format | tojson }}, {{ page.content | tojson }}, {{ page_favorited | tojson }})" x-init="init()">
|
||||
|
||||
<!-- ═══════════ Top Action Bar ═══════════ -->
|
||||
<div class="page-topbar">
|
||||
|
||||
Reference in New Issue
Block a user