parshap / html-linkify

Turn plain text links into safe HTML anchor elements
11 stars 5 forks source link

Port? #3

Closed kkm closed 10 years ago

kkm commented 10 years ago

Support with port? e.g www.google.com:443

parshap commented 10 years ago

Should work as expected:

> var linkify = require("linkify")
> linkify("www.google.com:443")
'<a href="http://www.google.com:443">www.google.com:443</a>'

I've added a test for this in 0161e9c.

kkm commented 10 years ago

Ok but if without www e.g google.com:80 doesnt work...

nalply commented 10 years ago

Thanks for the test case, but this might be still missing:

linkify("foo bar.com:8080 bar")

Expected result:

"foo <a href=\"bar.com:8080\">bar.com:8080</a> bar"
parshap commented 10 years ago

The reason "bar.com:8080" does not get changed to a link is because it doesn't start with "www" or "http://". See #4.