#NEWLINE# def handleMatch( self , m ) : #NEWLINE# #INDENT# url = m . group ( 2 ) #NEWLINE# if url . startswith ( '<' ) : #NEWLINE# #INDENT# url = url [ 1 : ( - 1 ) ] #NEWLINE# #UNINDENT# text = url #NEWLINE# if ( url . split ( '://' ) [ 0 ] not in ( 'http' , 'https' , 'ftp' ) ) : #NEWLINE# #INDENT# if ( ( '@' in url ) and ( '/' not in url ) ) : #NEWLINE# #INDENT# url = ( 'mailto:' + url ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# url = ( 'http://' + url ) #NEWLINE# #UNINDENT# #UNINDENT# el = markdown . util . etree . Element ( 'a' ) #NEWLINE# el . set ( 'href' , url ) #NEWLINE# el . text = markdown . util . AtomicString ( text ) #NEWLINE# return el