Skip to content

Commit 6f5508e

Browse files
committed
Merge branch 'release/8.2.2'
2 parents ea2ac62 + 61e1e88 commit 6f5508e

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ History
44
-------
55

66

7+
8.2.2 (017-04-03)
8+
+++++++++++++++++
9+
10+
* Fix invalid HTML in help texts (thanks @luksen)
11+
* Added `mark_safe` to placeholder (thanks @ppo)
12+
* Fix DateWidget import for newer Django versions (thanks @clokep)
13+
14+
715
8.2.1 (2017-02-23)
816
++++++++++++++++++
917

bootstrap3/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# -*- coding: utf-8 -*-
22

3-
__version__ = '8.2.1'
3+
__version__ = '8.2.2'

bootstrap3/renderers.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@
1111
TextInput, DateInput, FileInput, CheckboxInput, MultiWidget,
1212
ClearableFileInput, Select, RadioSelect, CheckboxSelectMultiple
1313
)
14-
from django.forms.extras import SelectDateWidget
14+
# Django 1.9 moved SelectDateWidget to django.forms.widget from
15+
# django.forms.extras. Django 2.0 will remove the old import location.
16+
try:
17+
from django.forms.widgets import SelectDateWidget
18+
except ImportError:
19+
from django.forms.extras import SelectDateWidget
1520
from django.forms.forms import BaseForm, BoundField
1621
from django.forms.formsets import BaseFormSet
1722
from django.utils.html import conditional_escape, escape, strip_tags
@@ -256,6 +261,8 @@ def __init__(self, field, *args, **kwargs):
256261
else:
257262
# Or just set it to empty
258263
self.placeholder = ''
264+
if self.placeholder:
265+
self.placeholder = text_value(mark_safe(self.placeholder))
259266

260267
self.addon_before = kwargs.get('addon_before', self.widget.attrs.pop('addon_before', ''))
261268
self.addon_after = kwargs.get('addon_after', self.widget.attrs.pop('addon_after', ''))
@@ -463,7 +470,7 @@ def append_to_field(self, html):
463470
'show_help': self.show_help,
464471
}
465472
)
466-
html += '<span class="help-block">{help}</span>'.format(help=help_html)
473+
html += help_html
467474
return html
468475

469476
def get_field_class(self):

0 commit comments

Comments
 (0)