mercurial/templater.py
changeset 2649 3b53fa20dda8
parent 2559 bf67d0f6531c
child 2875 3d6efcbbd1c9
equal deleted inserted replaced
2648:f47432ae5376 2649:3b53fa20dda8
   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('@')