Skip to content

Instantly share code, notes, and snippets.

@Cloudo
Created October 29, 2015 09:32
Show Gist options
  • Select an option

  • Save Cloudo/ca4897df21ce0b283c7c to your computer and use it in GitHub Desktop.

Select an option

Save Cloudo/ca4897df21ce0b283c7c to your computer and use it in GitHub Desktop.
from django.utils.safestring import mark_safe
from django import template
register = template.Library()
@register.filter()
def nbsp(value):
return mark_safe(" ".join(value.split(' ')))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment