Changeset 774

Show
Ignore:
Timestamp:
05/20/06 13:25:41 (6 years ago)
Author:
cboos
Message:

WikiGoodiesPlugin:

Added transformation of e-mail addresses into mailto: links.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • wikigoodiesplugin/0.9/goodies/__init__.py

    r356 r774  
    33from symbols import Symbols 
    44from mozilla import Mozilla 
     5from mailto import MailToLink 
    56 
    67 
  • wikigoodiesplugin/0.9/goodies/mailto.py

    r356 r774  
    1111 
    1212from trac.core import implements, Component 
     13from trac.util.markup import html 
    1314from trac.wiki import IWikiSyntaxProvider 
    1415 
    1516 
    16 class Mozilla(Component): 
     17class MailToLink(Component): 
    1718 
    1819    implements(IWikiSyntaxProvider) 
     
    2122 
    2223    def get_wiki_syntax(self): 
    23         word = r"[\w'!]+" 
    24         yield (r"(?:^|(?<=\W))(?:\*%s\*|/%s/|_%s_)(?:(?=\W)|$)" % ((word,)*3), 
    25                lambda x, y, z: (y[0] == '*' and '<strong>%s</strong>' or 
    26                                 y[0] == '/' and '<em>%s</em>' or 
    27                                 '<span class="underline">%s</span>') % y[1:-1]) 
     24        yield (r"<[^@]+@[^>]+>",  
     25               lambda x, y, z: html.A(y, href="mailto:%s" % y[1:-1])) 
    2826 
    2927    def get_link_resolvers(self):