nbsp filter

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# templatetags/nbsp.py

from django import template
from django.utils.safestring import mark_safe

register = template.Library()

@register.filter()
def nbsp(value):
    return mark_safe(" ".join(value.split(' ')))

More like this

  1. Avoid widows using a template filter by jcroft 6 years, 2 months ago
  2. Filter to add zero-width space to break up long words by jayliew 8 months ago
  3. wordbreak filter by soniiic 4 years, 1 month ago
  4. Variable inspect filter by buriy 5 years ago
  5. Querystring Builder - create urls with GET params by jibberia 2 years, 4 months ago

Comments

(Forgotten your password?)