fix: use backslash-escape for single quotes (not HTML entity)
HTML entities like ' are decoded by the browser BEFORE Alpine evaluates the expression, so the JS parser still sees a raw single quote. Backslash escape (\') is the correct approach: the HTML parser preserves it, then JavaScript interprets \' as an escaped quote in the string literal.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% macro render_workspace_tree(pages, depth=0) %}
|
||||
{% for page in pages %}
|
||||
{% set safe_name = page.name | replace("'", "'") %}
|
||||
{% set safe_name = page.name | replace("'", "\\'") %}
|
||||
<li class="sidebar-item ws-tree-item"
|
||||
data-id="{{ page.db_id }}"
|
||||
data-is-folder="{{ 'true' if page.is_folder else 'false' }}"
|
||||
|
||||
Reference in New Issue
Block a user