Skip to content

Instantly share code, notes, and snippets.

@minddust
minddust / spaceless_except_pre.py
Last active January 1, 2016 20:19
Django spaceless with preserved pre formatting
"""Copyright (c) 2013-2014 Stephan Groß, under MIT license."""
from __future__ import unicode_literals
import re
from django import template
from django.template import Node
from django.utils import six
from django.utils.encoding import force_text
from django.utils.functional import allow_lazy