Ticket #5396: trunc_email.2.diff

File trunc_email.2.diff, 900 bytes (added by deepak <deep.thukral@…>, 17 years ago)
  • html.py

     
    8686            if middle.startswith('http://') or middle.startswith('https://'):
    8787                middle = '<a href="%s"%s>%s</a>' % (middle, nofollow_attr, trim_url(middle))
    8888            if '@' in middle and not middle.startswith('www.') and not ':' in middle \
    89                 and simple_email_re.match(middle):
    90                 middle = '<a href="mailto:%s">%s</a>' % (middle, middle)
     89                and simple_email_re.match(middle) and len(middle.split('@')) == 2:
     90                name, domain = middle.split('@')
     91                middle = '<a href="mailto:%s">%s@%s</a>' % (middle, trim_url(name), domain)
    9192            if lead + middle + trail != word:
    9293                words[i] = lead + middle + trail
    9394    return u''.join(words)
Back to Top