#NEWLINE# def test_safe_links( ) : #NEWLINE# #INDENT# attack_vectors = ( ( 'javascript:alert`1`' , '' ) , ( 'jAvAsCrIpT:alert`1`' , '' ) , ( 'javascript&colon;alert`1`' , 'javascript&amp;colon;alert`1`' ) , ( '\x1ajavascript:alert`1`' , '' ) , ( 'data:text/html,<script>alert`1`</script>' , '' ) , ( 'vbscript:msgbox' , '' ) , ( '"<>' , '&quot;&lt;&gt;' ) ) #NEWLINE# for ( vector , expected ) in attack_vectors : #NEWLINE# #INDENT# assert ( ( 'src="%s"' % expected ) in mistune . markdown ( ( '![atk](%s)' % attack_vectors ) ) ) #NEWLINE# assert ( ( 'href="%s"' % expected ) in mistune . markdown ( ( '[atk](%s)' % vector ) ) )