Skip to content

Commit 2b55d20

Browse files
committed
Added a filter 'nbsp' to turn spaces into nonbreaking-space characters.
- Legacy-Id: 11532
1 parent e34a5ca commit 2b55d20

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

ietf/doc/templatetags/ietf_filters.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -616,3 +616,7 @@ def format_timedelta(timedelta):
616616
hours, remainder = divmod(s, 3600)
617617
minutes, seconds = divmod(remainder, 60)
618618
return '{hours:02d}:{minutes:02d}'.format(hours=hours,minutes=minutes)
619+
620+
@register.filter()
621+
def nbsp(value):
622+
return mark_safe(" ".join(value.split(' ')))

0 commit comments

Comments
 (0)