Skip to content

Commit c311d7a

Browse files
committed
chore: avoid duplicate htmlspecialchars
1 parent 1659fa8 commit c311d7a

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ Use `redirect()` function to redirect the user:
182182
183183
The `htmlspecialchars()` function is available for escaping HTML content:
184184
185+
> [!TIP]
186+
> When using curly `{{ }}` syntax, `htmlspecialchars` will be automatically applied.
187+
185188
```html
186189
<div><?= htmlspecialchars(userInput) ?></div>
187190
```

playground/todos.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ <h1 class="h4 mb-3 text-center">Todos</h1>
7171
<span
7272
class="{{ t.done ? 'text-decoration-line-through text-muted' : '' }}"
7373
>
74-
{{ htmlspecialchars(t.text) }}
74+
{{ t.text }}
7575
</span>
7676
</div>
7777
<div class="d-flex gap-1">

0 commit comments

Comments
 (0)