comparison mercurial/templater.py @ 2646:8796d9991100

merge with crew.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Mon, 24 Jul 2006 09:12:16 -0700
parents 3b53fa20dda8
children 3d6efcbbd1c9
comparison
equal deleted inserted replaced
2645:e6a41cbaa260 2646:8796d9991100
239 def nl2br(text): 239 def nl2br(text):
240 '''replace raw newlines with xhtml line breaks.''' 240 '''replace raw newlines with xhtml line breaks.'''
241 return text.replace('\n', '<br/>\n') 241 return text.replace('\n', '<br/>\n')
242 242
243 def obfuscate(text): 243 def obfuscate(text):
244 text = unicode(text, 'utf-8', 'replace')
244 return ''.join(['&#%d;' % ord(c) for c in text]) 245 return ''.join(['&#%d;' % ord(c) for c in text])
245 246
246 def domain(author): 247 def domain(author):
247 '''get domain of author, or empty string if none.''' 248 '''get domain of author, or empty string if none.'''
248 f = author.find('@') 249 f = author.find('@')