Quantcast
Channel: Mako: Ticket Query
Viewing all articles
Browse latest Browse all 38

#149: Add new filter "nbsp"

$
0
0

Hi,

What do you think about adding a filter for non-breaking spaces? I assume that it could be very help full for a lot of people.

Example:

diff -r 4dc291a1bc1c mako/filters.py
--- a/mako/filters.py   Tue Sep 14 10:54:22 2010 +0200
+++ b/mako/filters.py   Wed Sep 15 08:41:05 2010 +0200
@@ -39,6 +39,9 @@
 def trim(string):
     return string.strip()
+def nbsp(string):
+    return string.replace(' ', ' ')
+
 class Decode(object):
     def __getattr__(self, key):
@@ -161,6 +164,7 @@
     'h':'filters.html_escape',
     'u':'filters.url_escape',
     'trim':'filters.trim',
+    'nbsp':'filters.nbsp',
     'entity':'filters.html_entities_escape',
     'unicode':'unicode',
     'decode':'decode',

Regards, Carsten


Viewing all articles
Browse latest Browse all 38

Trending Articles