#NEWLINE# def _process_links( self , frag ) : #NEWLINE# #INDENT# site = Site . objects . get_current ( ) #NEWLINE# for a in frag . cssselect ( 'a' ) : #NEWLINE# #INDENT# if ( ( 'href' in self . attrib ) and ( not a . attrib [ 'href' ] . startswith ( '/' ) ) and ( not a . attrib [ 'href' ] . startswith ( '.' ) ) and ( urlparse . urlparse ( a . attrib [ 'href' ] ) . netloc . split ( '.' ) [ ( - 2 ) : ] != site . domain . split ( '.' ) [ ( - 2 ) : ] ) ) : #NEWLINE# #INDENT# a . attrib [ 'rel' ] = 'nofollow' #NEWLINE# a . attrib [ 'target' ] = '_blank' #NEWLINE# #UNINDENT# #UNINDENT# return frag