Created
August 22, 2011 19:40
-
-
Save episod/1163313 to your computer and use it in GitHub Desktop.
URLs theoretically wrapped with t.co on status ingestion
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
urls: | |
- description: "Autolink URL with pipe character" | |
text: "text http://example.com/pipe|character?yes|pipe|character" | |
expected: "text <a href=\"http://example.com/pipe|character?yes|pipe|character\">http://example.com/pipe|character?yes|pipe|character</a>" | |
- description: "Autolink trailing url" | |
text: "text http://example.com" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>" | |
- description: "Autolink url in mid-text" | |
text: "text http://example.com more text" | |
expected: "text <a href=\"http://example.com\">http://example.com</a> more text" | |
- description: "Autolink url in Japanese text" | |
text: "いまなにしてるhttp://example.comいまなにしてる" | |
expected: "いまなにしてる<a href=\"http://example.com\">http://example.com</a>いまなにしてる" | |
- description: "Autolink url surrounded by parentheses does not capture them" | |
text: "text (http://example.com)" | |
expected: "text (<a href=\"http://example.com\">http://example.com</a>)" | |
- description: "Autolink url with path surrounded by parentheses does not capture them" | |
text: "text (http://example.com/test)" | |
expected: "text (<a href=\"http://example.com/test\">http://example.com/test</a>)" | |
- description: "Autolink url with embedded parentheses" | |
text: "text http://msdn.com/S(deadbeef)/page.htm" | |
expected: "text <a href=\"http://msdn.com/S(deadbeef)/page.htm\">http://msdn.com/S(deadbeef)/page.htm</a>" | |
- description: "Autolink url with balanced parens hiding XSS" | |
text: 'text http://foo.bar/("onclick="alert(1)")' | |
expected: 'text <a href="http://foo.bar/">http://foo.bar/</a>("onclick="alert(1)")' | |
- description: "Autolink url should NOT capture unbalanced parens" | |
text: "Parenthetically bad http://example.com/i_has_a_) thing" | |
expected: "Parenthetically bad <a href=\"http://example.com/i_has_a_\">http://example.com/i_has_a_</a>) thing" | |
- description: "Autolink url containing unicode characters" | |
text: "I enjoy Macintosh Brand computers: http://✪df.ws/ejp" | |
expected: "I enjoy Macintosh Brand computers: <a href=\"http://✪df.ws/ejp\">http://✪df.ws/ejp</a>" | |
- description: "Autolink url with .co. under TLD" | |
text: "test http://www.example.co.jp" | |
expected: "test <a href=\"http://www.example.co.jp\">http://www.example.co.jp</a>" | |
- description: "DO NOT Autolink url containing ! character in the domain" | |
text: "badly formatted http://foo!bar.com" | |
expected: "badly formatted http://foo!bar.com" | |
- description: "DO NOT Autolink url containing _ character in the domain" | |
text: "badly formatted http://foo_bar.com" | |
expected: "badly formatted http://foo_bar.com" | |
- description: "Autolink url preceded by :" | |
text: "text:http://example.com" | |
expected: "text:<a href=\"http://example.com\">http://example.com</a>" | |
- description: "Autolink url followed by ? (without it)" | |
text: "text http://example.com?" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>?" | |
- description: "Autolink url followed by ! (without it)" | |
text: "text http://example.com!" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>!" | |
- description: "Autolink url followed by , (without it)" | |
text: "text http://example.com," | |
expected: "text <a href=\"http://example.com\">http://example.com</a>," | |
- description: "Autolink url with path followed by a comma (wihout the comma)" | |
text: "In http://example.com/test, Douglas explains 42." | |
expected: "In <a href=\"http://example.com/test\">http://example.com/test</a>, Douglas explains 42." | |
- description: "Autolink url followed by . (without it)" | |
text: "text http://example.com." | |
expected: "text <a href=\"http://example.com\">http://example.com</a>." | |
- description: "Autolink url followed by : (without it)" | |
text: "text http://example.com:" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>:" | |
- description: "Autolink url followed by ; (without it)" | |
text: "text http://example.com;" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>;" | |
- description: "Autolink url followed by ] (without it)" | |
text: "text http://example.com]" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>]" | |
- description: "Autolink url followed by ) (without it)" | |
text: "text http://example.com)" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>)" | |
- description: "Autolink url followed by } (without it)" | |
text: "text http://example.com}" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>}" | |
- description: "Autolink url followed by = (without it)" | |
text: "text http://example.com=" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>=" | |
- description: "Autolink url followed by ' (without it)" | |
text: "text http://example.com'" | |
expected: "text <a href=\"http://example.com\">http://example.com</a>'" | |
- description: "DO NOT Autolink url preceded by /" | |
text: "text /http://example.com" | |
expected: "text /http://example.com" | |
- description: "DO NOT Autolink url preceded by !" | |
text: "text !http://example.com" | |
expected: "text !http://example.com" | |
- description: "DO NOT Autolink url preceded by =" | |
text: "text =http://example.com" | |
expected: "text =http://example.com" | |
- description: "DO NOT Autolink url preceded by @" | |
text: "@http://example.com" | |
expected: "@http://example.com" | |
- description: "DO NOT Autolink domain in email address" | |
text: "[email protected]" | |
expected: "[email protected]" | |
- description: "Autolink url embedded in link tag" | |
text: "<link rel='true'>http://example.com</link>" | |
expected: "<link rel='true'><a href=\"http://example.com\">http://example.com</a></link>" | |
- description: "Autolink multiple urls" | |
text: "http://example.com https://sslexample.com http://sub.example.com" | |
expected: "<a href=\"http://example.com\">http://example.com</a> <a href=\"https://sslexample.com\">https://sslexample.com</a> <a href=\"http://sub.example.com\">http://sub.example.com</a>" | |
- description: "Autolink url with long TLD" | |
text: "http://example.mobi/path" | |
expected: "<a href=\"http://example.mobi/path\">http://example.mobi/path</a>" | |
- description: "Autolink url containing ending with #value (not as url + hashtag)" | |
text: "http://foo.com/?#foo" | |
expected: "<a href=\"http://foo.com/?#foo\">http://foo.com/?#foo</a>" | |
- description: "DO NOT Autolink url without protocol (with www)" | |
text: "www.example.biz" | |
expected: "www.example.biz" | |
- description: "DO NOT Autolink url without protocol (with WWW)" | |
text: "WWW.EXAMPLE.BIZ" | |
expected: "WWW.EXAMPLE.BIZ" | |
- description: "DO NOT Autolink URL without protocol and without www (ending in .com)" | |
text: "foo.com" | |
expected: "foo.com" | |
- description: "DO NOT Autolink URL without protocol and without www (ending in .org)" | |
text: "foo.org" | |
expected: "foo.org" | |
- description: "DO NOT Autolink URL without protocol and without www (ending in .net)" | |
text: "foo.net" | |
expected: "foo.net" | |
- description: "DO NOT Autolink URL without protocol and without www (ending in .gov)" | |
text: "foo.gov" | |
expected: "foo.gov" | |
- description: "DO NOT Autolink URL without protocol and without www (ending in .edu)" | |
text: "foo.edu" | |
expected: "foo.edu" | |
- description: "Autolink URL without protocol and without www not ending in /.(edu|com|gov|org|net)/" | |
text: "foo.it twitter.co.jp foo.commerce foo.nettastic foo.us foo.co.uk" | |
expected: "foo.it twitter.co.jp foo.commerce foo.nettastic foo.us foo.co.uk" | |
- description: "Multiple URLs with different protocols but not without a protocol" | |
text: "http://foo.com AND https://bar.com AND www.foobar.com" | |
expected: "<a href=\"http://foo.com\">http://foo.com</a> AND <a href=\"https://bar.com\">https://bar.com</a> AND www.foobar.com" | |
- description: "Autolink raw domain followed by domain only links the first" | |
text: "See http://example.com example.com" | |
expected: "See <a href=\"http://example.com\">http://example.com</a> example.com" | |
- description: "Autolink url that includes @-sign and numeric dir under it" | |
text: "http://www.flickr.com/photos/29674651@N00/4382024406" | |
expected: "<a href=\"http://www.flickr.com/photos/29674651@N00/4382024406\">http://www.flickr.com/photos/29674651@N00/4382024406</a>" | |
- description: "Autolink url that includes @-sign and non-numeric dir under it" | |
text: "http://www.flickr.com/photos/29674651@N00/foobar" | |
expected: "<a href=\"http://www.flickr.com/photos/29674651@N00/foobar\">http://www.flickr.com/photos/29674651@N00/foobar</a>" | |
- description: "Autolink URL with only a domain followed by a period doesn't swallow the period." | |
text: "I think it's proper to end sentences with a period http://tell.me. Even when they contain a URL." | |
expected: "I think it's proper to end sentences with a period <a href=\"http://tell.me\">http://tell.me</a>. Even when they contain a URL." | |
- description: "Autolink URL with a path followed by a period doesn't swallow the period." | |
text: "I think it's proper to end sentences with a period http://tell.me/why. Even when they contain a URL." | |
expected: "I think it's proper to end sentences with a period <a href=\"http://tell.me/why\">http://tell.me/why</a>. Even when they contain a URL." | |
- description: "Autolink URL with a query followed by a period doesn't swallow the period." | |
text: "I think it's proper to end sentences with a period http://tell.me/why?=because.i.want.it. Even when they contain a URL." | |
expected: "I think it's proper to end sentences with a period <a href=\"http://tell.me/why?=because.i.want.it\">http://tell.me/why?=because.i.want.it</a>. Even when they contain a URL." | |
- description: "Autolink URL with a hyphen in the domain name" | |
text: "Czech out sweet deals at http://mrs.domain-dash.biz ok?" | |
expected: "Czech out sweet deals at <a href=\"http://mrs.domain-dash.biz\">http://mrs.domain-dash.biz</a> ok?" | |
- description: "Autolink an IDN (punycode) domain and TLD" | |
text: "See also: http://xn--80abe5aohbnkjb.xn--p1ai/" | |
expected: "See also: <a href=\"http://xn--80abe5aohbnkjb.xn--p1ai/\">http://xn--80abe5aohbnkjb.xn--p1ai/</a>" | |
- description: "Autolink URL should NOT autolink www...foo" | |
text: "Is www...foo a valid URL?" | |
expected: "Is www...foo a valid URL?" | |
- description: "Autolink URL should NOT autolink www.-foo.com" | |
text: "Is www.-foo.com a valid URL?" | |
expected: "Is www.-foo.com a valid URL?" | |
- description: "Autolink URL should NOT autolink a domain with a valid dash but no protocol" | |
text: "Is www.foo-bar.com a valid URL?" | |
expected: "Is www.foo-bar.com a valid URL?" | |
- description: "Autolink URL should autolink a domain with a valid dash and a protocol" | |
text: "Is http://www.foo-bar.com a valid URL?" | |
expected: "Is <a href=\"http://www.foo-bar.com\">http://www.foo-bar.com</a> a valid URL?" | |
- description: "Autolink URL should link search urls (with &lang=, not ⟨)" | |
text: "Check out http://search.twitter.com/search?q=avro&lang=en" | |
expected: "Check out <a href=\"http://search.twitter.com/search?q=avro&lang=en\">http://search.twitter.com/search?q=avro&lang=en</a>" | |
- description: "Autolink URL should link urls with very long paths" | |
text: "Check out http://example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</a>" | |
- description: "Autolink URL should HTML escape the URL" | |
text: "example: http://twitter.com/otm_m@\"onmousedown=\"alert('foo')\" style=background-color:yellow;color:yellow;\"/" | |
expected: "example: <a href=\"http://twitter.com/otm_m\">http://twitter.com/otm_m</a>@\"onmousedown=\"alert('foo')\" style=background-color:yellow;color:yellow;\"/" | |
- description: "Autolink URL should autolink a URL with a - or + at the end of the path" | |
text: "Go to http://example.com/a+ or http://example.com/a-" | |
expected: "Go to <a href=\"http://example.com/a+\">http://example.com/a+</a> or <a href=\"http://example.com/a-\">http://example.com/a-</a>" | |
- description: "Autolink URL should autolink a URL with a - or + at the end of the path and query parameters" | |
text: "Go to http://example.com/a+?this=that or http://example.com/a-?this=that" | |
expected: "Go to <a href=\"http://example.com/a+?this=that\">http://example.com/a+?this=that</a> or <a href=\"http://example.com/a-?this=that\">http://example.com/a-?this=that</a>" | |
- description: "Autolink URL should autolink URLs with longer paths ending in -" | |
text: "Go to http://example.com/view/slug-url-?foo=bar" | |
expected: "Go to <a href=\"http://example.com/view/slug-url-?foo=bar\">http://example.com/view/slug-url-?foo=bar</a>" | |
- description: "Autolink URL should NOT link URLs with domains beginning in a space" | |
text: "@user Try http:// example.com/path" | |
expected: "@user Try http:// example.com/path" | |
- description: "Autolink URL should NOT link URLs with domains beginning in a non-breaking space (U+00A0)" | |
text: "@user Try http:// example.com/path" | |
expected: "@user Try http:// example.com/path" | |
- decription: "Autolink URL should link paths containing accented characters" | |
text: "See: http://example.com/café" | |
expected: "See: <a href=\"http://example.com/café\">http://example.com/café</a>" | |
all: | |
- description: "Autolink all does not break on URL with @" | |
text: "http://www.flickr.com/photos/29674651@N00/4382024406 if you know what's good for you." | |
expected: "<a href=\"http://www.flickr.com/photos/29674651@N00/4382024406\">http://www.flickr.com/photos/29674651@N00/4382024406</a> if you know what's good for you." | |
- description: "Autolink all does not allow & without ?" | |
text: "Check out: http://example.com/test&@chasesechrist" | |
expected: "Check out: <a href=\"http://example.com/test\">http://example.com/test</a>&@<a class=\"tweet-url username\" href=\"http://twitter.com/chasesechrist\">chasesechrist</a>" | |
- description: "Correctly handles URL follower directly by @user" | |
text: "See: http://example.com/@user" | |
expected: "See: <a href=\"http://example.com/\">http://example.com/</a>@<a class=\"tweet-url username\" href=\"http://twitter.com/user\">user</a>" | |
- description: "Correctly handles URL with an @user followed by trailing /" | |
text: "See: http://example.com/@user/" | |
expected: "See: <a href=\"http://example.com/@user/\">http://example.com/@user/</a>" | |
- description: "Does not allow an XSS after an @" | |
text: "See: http://x.xx/@\"style=\"color:pink\"onmouseover=alert(1)//" | |
expected: "See: <a href=\"http://x.xx/\">http://x.xx/</a>@\"style=\"color:pink\"onmouseover=alert(1)//" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment