Skip to content

Commit

Permalink
Merge pull request #271 from Grelek/feature-label_empty_string
Browse files Browse the repository at this point in the history
Don't escape HTML entity for space
  • Loading branch information
Dylan Verheul committed Aug 17, 2015
2 parents bbc2610 + 970946c commit fa53d69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion bootstrap3/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
PasswordInput
)
from django.forms.widgets import CheckboxInput
from django.utils.safestring import mark_safe

from .bootstrap import (
get_bootstrap_setting, get_form_renderer, get_field_renderer,
Expand Down Expand Up @@ -135,7 +136,7 @@ def render_field_and_label(
if not field_class:
field_class = get_bootstrap_setting('horizontal_field_class')
if not label:
label = ' '
label = mark_safe(' ')
label_class = add_css_class(label_class, 'control-label')
html = field
if field_class:
Expand Down
2 changes: 1 addition & 1 deletion bootstrap3/renderers.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def get_label(self):
else:
label = self.field.label
if self.layout == 'horizontal' and not label:
return ' '
return mark_safe(' ')
return label

def add_label(self, html):
Expand Down

0 comments on commit fa53d69

Please sign in to comment.