askbot.middleware.spaceless

Middleware that strips whitespace between html tags copied from David Cramer’s blog http://www.davidcramer.net/code/369/spaceless-html-in-django.html

class askbot.middleware.spaceless.SpacelessMiddleware

Bases: object

process_response(request, response)

strips whitespace from all documents whose content type is text/html

askbot.middleware.spaceless.reduce_spaces_between_tags(*args, **kwargs)

Returns the given HTML with all spaces between tags removed. ,but one. One space is left so that consecutive links and other things do not appear glued together slight mod of django.utils.html import strip_spaces_between_tags

This Page