mercurial/templater.py
changeset 3904 0dd07dd63db3
parent 3647 734e337cb816
child 3906 1063a631cb8e
child 4334 66a3fe30f9fc
equal deleted inserted replaced
3901:733d56b8830f 3904:0dd07dd63db3
   202 def nl2br(text):
   202 def nl2br(text):
   203     '''replace raw newlines with xhtml line breaks.'''
   203     '''replace raw newlines with xhtml line breaks.'''
   204     return text.replace('\n', '<br/>\n')
   204     return text.replace('\n', '<br/>\n')
   205 
   205 
   206 def obfuscate(text):
   206 def obfuscate(text):
   207     text = unicode(text, 'utf-8', 'replace')
   207     text = unicode(text, util._encoding, 'replace')
   208     return ''.join(['&#%d;' % ord(c) for c in text])
   208     return ''.join(['&#%d;' % ord(c) for c in text])
   209 
   209 
   210 def domain(author):
   210 def domain(author):
   211     '''get domain of author, or empty string if none.'''
   211     '''get domain of author, or empty string if none.'''
   212     f = author.find('@')
   212     f = author.find('@')