aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/url.rs
diff options
context:
space:
mode:
authorJokler <jokler.contact@gmail.com>2017-12-12 00:10:25 +0100
committerJokler <jokler.contact@gmail.com>2017-12-12 00:10:25 +0100
commit57a6791edcfe0fb508a88ef2c7255ecd7c3142fb (patch)
treec9c59b37398e4bae36c2529bf580a4a3fdf2d762 /src/plugins/url.rs
parentbe3661ca2115ab704697b45628ed9984b924ad76 (diff)
downloadfrippy-57a6791edcfe0fb508a88ef2c7255ecd7c3142fb.tar.gz
frippy-57a6791edcfe0fb508a88ef2c7255ecd7c3142fb.zip
Only match urls which start with http
Diffstat (limited to 'src/plugins/url.rs')
-rw-r--r--src/plugins/url.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/url.rs b/src/plugins/url.rs
index ec146a0..e954638 100644
--- a/src/plugins/url.rs
+++ b/src/plugins/url.rs
@@ -18,7 +18,7 @@ use self::select::predicate::Name;
use plugin::*;
lazy_static! {
- static ref RE: Regex = Regex::new(r"http(s)?://(\S+)").unwrap();
+ static ref RE: Regex = Regex::new(r"(^|\s)(https?://\S+)").unwrap();
}
#[derive(PluginName, Debug)]
@@ -37,7 +37,7 @@ impl Url {
Some(captures) => {
debug!("Url captures: {:?}", captures);
- Some(captures.get(0).unwrap().as_str().to_string())
+ Some(captures.get(2).unwrap().as_str().to_string())
}
None => None,
}