From 0eaee6f5d4976f3b0146d512c43d2f9a19f39021 Mon Sep 17 00:00:00 2001 From: Adrian Holovaty Date: Sun, 15 Jan 2006 01:51:30 +0000 Subject: Fixed #1067 and #276 -- Added a {% spaceless %} tag, available in all templates git-svn-id: http://code.djangoproject.com/svn/django/trunk@1967 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- docs/templates.txt | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'docs') diff --git a/docs/templates.txt b/docs/templates.txt index d4bb468bd5..0fbe1f6ae8 100644 --- a/docs/templates.txt +++ b/docs/templates.txt @@ -663,6 +663,34 @@ i.e.:: {% regroup people|dictsort:"gender" by gender as grouped %} +spaceless +~~~~~~~~~ + +**New in Django development version.** + +Strips whitespace between HTML tags. This includes tab characters and newlines. + +Example usage:: + + {% spaceless %} +

+ Foo +

+ {% spaceless %} + +This example would return this HTML:: + +

Foo

+ +Only space between *tags* is stripped -- not space between tags and text. In +this example, the space around ``Hello`` won't be stripped:: + + {% spaceless %} + + Hello + + {% spaceless %} + ssi ~~~ -- cgit v1.3