Skip to content

Commit 3e791b5

Browse files
committed
add sanitize_html filter
1 parent 583e631 commit 3e791b5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

templates/admin/blog/show.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
<p class="m-b-0"><strong>{{ 'label.summary'|trans }}</strong>: {{ post.summary }}</p>
1515
</div>
1616

17-
{{ post.content|markdown_to_html }}
17+
{{ post.content|markdown_to_html|sanitize_html }}
1818

1919
{{ include('blog/_post_tags.html.twig') }}
2020
{% endblock %}

templates/blog/post_show.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<span class="metadata"><i class="fa fa-user"></i> {{ post.author.fullName }}</span>
1111
</p>
1212

13-
{{ post.content|markdown_to_html }}
13+
{{ post.content|markdown_to_html|sanitize_html }}
1414

1515
{{ include('blog/_post_tags.html.twig') }}
1616

@@ -48,7 +48,7 @@
4848
<strong>{{ comment.publishedAt|format_datetime('medium', 'short', '', 'UTC') }}</strong>
4949
</h4>
5050
<div class="col-sm-9">
51-
{{ comment.content|markdown_to_html }}
51+
{{ comment.content|markdown_to_html|sanitize_html }}
5252
</div>
5353
</div>
5454
{% else %}

0 commit comments

Comments
 (0)