templatefilters: match filter keys and function names
authorPatrick Mezard <pmezard@gmail.com>
Sat, 12 Mar 2011 12:46:31 +0100
changeset 13587 9fb6850d5d97
parent 13586 57150dc5a9c7
child 13588 b8b881f3f3a7
templatefilters: match filter keys and function names
mercurial/templatefilters.py
--- a/mercurial/templatefilters.py	Sat Mar 12 12:46:31 2011 +0100
+++ b/mercurial/templatefilters.py	Sat Mar 12 12:46:31 2011 +0100
@@ -81,7 +81,7 @@
     except IndexError:
         return ''
 
-def nl2br(text):
+def addbreaks(text):
     '''replace raw newlines with xhtml line breaks.'''
     return text.replace('\n', '<br/>\n')
 
@@ -192,7 +192,7 @@
     return str or "(none)"
 
 filters = {
-    "addbreaks": nl2br,
+    "addbreaks": addbreaks,
     "age": age,
     "basename": os.path.basename,
     "date": lambda x: util.datestr(x),