1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #20246 -- Added non-breaking spaces between values an units

This commit is contained in:
Emil Stenström
2013-05-18 13:58:45 +02:00
committed by Claude Paroz
parent caf56ad174
commit 7d77e9786a
9 changed files with 155 additions and 130 deletions

View File

@@ -281,3 +281,10 @@ def clean_html(text):
text = trailing_empty_content_re.sub('', text)
return text
clean_html = allow_lazy(clean_html, six.text_type)
def avoid_wrapping(value):
"""
Avoid text wrapping in the middle of a phrase by adding non-breaking
spaces where there previously were normal spaces.
"""
return value.replace(" ", "\xa0")