Skip to content

Commit

Permalink
Revert "Removed |safe filter from help text (#66)"
Browse files Browse the repository at this point in the history
This reverts commit 52156bf.
  • Loading branch information
Archmonger committed Jan 13, 2022
1 parent 8bccd51 commit e1c12cd
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 24 deletions.
4 changes: 2 additions & 2 deletions crispy_bootstrap5/templates/bootstrap5/layout/help_text.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{% if field.help_text %}
{% if help_text_inline %}
<span id="hint_{{ field.auto_id }}" class="text-muted">{{ field.help_text }}</span>
<span id="hint_{{ field.auto_id }}" class="text-muted">{{ field.help_text|safe }}</span>
{% else %}
<small id="hint_{{ field.auto_id }}" class="form-text text-muted">{{ field.help_text }}</small>
<small id="hint_{{ field.auto_id }}" class="form-text text-muted">{{ field.help_text|safe }}</small>
{% endif %}
{% endif %}
9 changes: 0 additions & 9 deletions tests/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,12 +284,3 @@ class GroupedChoiceForm(forms.Form):
widget=forms.CheckboxSelectMultiple, choices=choices
)
radio = forms.MultipleChoiceField(widget=forms.RadioSelect, choices=choices)


class HelpTextForm(forms.Form):
email = forms.EmailField(
label="email",
required=True,
widget=forms.TextInput(),
help_text="Insert your email<>&",
)
5 changes: 0 additions & 5 deletions tests/results/help_text_escape.html

This file was deleted.

8 changes: 0 additions & 8 deletions tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
CrispyTestModel,
FileForm,
FileFormRequired,
HelpTextForm,
InputsForm,
LabelForm,
SampleForm,
Expand Down Expand Up @@ -641,10 +640,3 @@ def test_flat_attrs_safe():
)
form.helper.form_tag = False
assert parse_form(form) == parse_expected("flat_attrs.html")


def test_help_text_escape():
form = HelpTextForm()
form.helper = FormHelper()
form.helper.form_tag = False
assert parse_form(form) == parse_expected("help_text_escape.html")

0 comments on commit e1c12cd

Please sign in to comment.