Skip to content
This repository has been archived by the owner on Sep 18, 2021. It is now read-only.

Commit

Permalink
Allow unicode characters in domains and colons preceding urls
Browse files Browse the repository at this point in the history
  • Loading branch information
hoverbird committed Feb 3, 2010
1 parent b5f7f2d commit ba87602
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
10 changes: 9 additions & 1 deletion autolink.yml
Expand Up @@ -145,7 +145,15 @@ tests:


- description: "Autolink url surrounded by parentheses" - description: "Autolink url surrounded by parentheses"
text: "text (http://example.com)" text: "text (http://example.com)"
expected: "text (<a href=\"http://example.com\">http://example.com</a>)" expected: 'text (<a href=\"http://example.com\">http://example.com</a>)'

- 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 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)" - description: "Autolink url followed by ? (without it)"
text: "text http://example.com?" text: "text http://example.com?"
Expand Down
8 changes: 4 additions & 4 deletions extract.yml
Expand Up @@ -135,6 +135,10 @@ tests:
text: "text http://www.ams.org/bookstore-getitem/item=mbk-59" text: "text http://www.ams.org/bookstore-getitem/item=mbk-59"
expected: ["http://www.ams.org/bookstore-getitem/item=mbk-59"] expected: ["http://www.ams.org/bookstore-getitem/item=mbk-59"]


- description: "Extract valid URL: http://✪df.ws/ejp"
text: "text http://✪df.ws/ejp"
expected: ["http://✪df.ws/ejp"]

- description: "Extract valid URL: http://chilp.it/?77e8fd" - description: "Extract valid URL: http://chilp.it/?77e8fd"
text: "text http://chilp.it/?77e8fd" text: "text http://chilp.it/?77e8fd"
expected: ["http://chilp.it/?77e8fd"] expected: ["http://chilp.it/?77e8fd"]
Expand All @@ -151,10 +155,6 @@ tests:
text: "text http://tld-too-short.x" text: "text http://tld-too-short.x"
expected: [] expected: []


- description: "DO NOT extract invalid URL: http://doman-dash_2314352345_dfasd.foo-cow_4352.com"
text: "text http://doman-dash_2314352345_dfasd.foo-cow_4352.com"
expected: []

hashtags: hashtags:
- description: "Extract an all-alpha hashtag" - description: "Extract an all-alpha hashtag"
text: "a #hashtag here" text: "a #hashtag here"
Expand Down

0 comments on commit ba87602

Please sign in to comment.