Skip to content

Commit fa53d69

Browse files
author
Dylan Verheul
committed
Merge pull request zostera#271 from Grelek/feature-label_empty_string
Don't escape HTML entity for space
2 parents bbc2610 + 970946c commit fa53d69

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

bootstrap3/forms.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
PasswordInput
88
)
99
from django.forms.widgets import CheckboxInput
10+
from django.utils.safestring import mark_safe
1011

1112
from .bootstrap import (
1213
get_bootstrap_setting, get_form_renderer, get_field_renderer,
@@ -135,7 +136,7 @@ def render_field_and_label(
135136
if not field_class:
136137
field_class = get_bootstrap_setting('horizontal_field_class')
137138
if not label:
138-
label = ' '
139+
label = mark_safe(' ')
139140
label_class = add_css_class(label_class, 'control-label')
140141
html = field
141142
if field_class:

bootstrap3/renderers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,7 @@ def get_label(self):
455455
else:
456456
label = self.field.label
457457
if self.layout == 'horizontal' and not label:
458-
return ' '
458+
return mark_safe(' ')
459459
return label
460460

461461
def add_label(self, html):

0 commit comments

Comments
 (0)