Browse files

Allow hyphens in domain names, except at the beginning. Disallow sing…

…le-letter domains.
  • Loading branch information...
1 parent 0913a3d commit 655fdaada91dfa99074b1b40662244544174b0ce @hoverbird hoverbird committed Apr 15, 2010
Showing with 21 additions and 13 deletions.
  1. +6 −2 autolink.yml
  2. +15 −11 extract.yml
View
8 autolink.yml
@@ -267,8 +267,12 @@ tests:
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?"
+
all:
- description: "Autolink all does not break on URL with @"
- 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>"
+ 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."
View
26 extract.yml
@@ -119,17 +119,17 @@ tests:
text: "text http://somehost.com:3000"
expected: ["http://somehost.com:3000"]
- - description: "Extract valid URL: http://x.com/~matthew+%-x"
- text: "text http://x.com/~matthew+%-x"
- expected: ["http://x.com/~matthew+%-x"]
+ - description: "Extract valid URL: http://xo.com/~matthew+%-x"
+ text: "text http://xo.com/~matthew+%-x"
+ expected: ["http://xo.com/~matthew+%-x"]
- - description: "Extract valid URL: http://x.com/~matthew+%-,.;x"
- text: "text http://x.com/~matthew+%-,.;x"
- expected: ["http://x.com/~matthew+%-,.;x"]
+ - description: "Extract valid URL: http://xo.com/~matthew+%-,.;x"
+ text: "text http://xo.com/~matthew+%-,.;x"
+ expected: ["http://xo.com/~matthew+%-,.;x"]
- - description: "Extract valid URL: http://x.com/,.;x"
- text: "text http://x.com/,.;x"
- expected: ["http://x.com/,.;x"]
+ - description: "Extract valid URL: http://xo.com/,.;x"
+ text: "text http://xo.com/,.;x"
+ expected: ["http://xo.com/,.;x"]
- description: "Extract valid URL: http://en.wikipedia.org/wiki/Primer_(film)"
text: "text http://en.wikipedia.org/wiki/Primer_(film)"
@@ -142,15 +142,19 @@ tests:
- 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"
text: "text http://chilp.it/?77e8fd"
expected: ["http://chilp.it/?77e8fd"]
- - description: "DO NOT extract invalid URL: http://doman-dash_2314352345_dfasd.foo-cow_4352.com"
+ - description: "DO NOT extract invalid URL: http://-begin_dash_2314352345_dfasd.foo-cow_4352.com"
text: "text http://doman-dash_2314352345_dfasd.foo-cow_4352.com"
expected: []
+ - description: "DO NOT extract invalid URL: http://x.com/oneletterdomain"
+ text: "text http://x.com/oneletterdomain"
+ expected: []
+
- description: "DO NOT extract invalid URL: http://no-tld"
text: "text http://no-tld"
expected: []

0 comments on commit 655fdaa

Please sign in to comment.