Skip to content

Commit

Permalink
fix: Incorrect symbols on wiki create article page (#32628)
Browse files Browse the repository at this point in the history
The message was being double-escaped by React with the
StatusAlertRenderer. This fixes the problem by removing the
first layer of HTML-escaping so it is only escaped once.
  • Loading branch information
DmytroAlipov authored Jul 10, 2023
1 parent 00b1ce2 commit bb4beab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lms/templates/wiki/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,15 @@
{% block wiki_breadcrumbs %}{% endblock %}

{% if messages %}
{% comment %}
The message is not actually safe, but StatusAlertRenderer uses react which adds escaping,
so marking as safe keeps the message from being double-escaped.
{% endcomment %}
{% for message in messages %}
<div id="alert_stat_bar"></div>
<script type="text/javascript">
new StatusAlertRenderer(
"{{ message }}",
"{{ message|safe }}",
"#alert_stat_bar",
".nav nav-tabs"
);
Expand Down

0 comments on commit bb4beab

Please sign in to comment.