robinst / linkify

Rust library to find links such as URLs and email addresses in plain text, handling surrounding punctuation correctly
https://robinst.github.io/linkify/
Apache License 2.0
206 stars 12 forks source link

Don't link if authority is only "end" characters #2

Closed robinst closed 7 years ago

robinst commented 7 years ago

This change stops these and other examples from being linked:

http://.
http://"
http://<space>

Note that http:// and http://. are valid URLs according to RFC 3986, because authority can be zero or more unreserved characters. But we don't link http:// on its own or the trailing . of http://example.org.

(See https://github.com/robinst/autolink-java/issues/15)

codecov-io commented 7 years ago

Codecov Report

Merging #2 into master will increase coverage by 0.02%. The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master      #2      +/-   ##
=========================================
+ Coverage   96.58%   96.6%   +0.02%     
=========================================
  Files           7       7              
  Lines         468     471       +3     
=========================================
+ Hits          452     455       +3     
  Misses         16      16
Impacted Files Coverage Δ
tests/url.rs 100% <100%> (ø) :arrow_up:
src/url.rs 100% <100%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 41b7553...6429c17. Read the comment docs.