]> git.lizzy.rs Git - rust.git/commitdiff
Add ftp and file protocols
authortopecongiro <seuchida@gmail.com>
Wed, 1 Nov 2017 03:35:32 +0000 (12:35 +0900)
committertopecongiro <seuchida@gmail.com>
Wed, 1 Nov 2017 03:35:32 +0000 (12:35 +0900)
src/comment.rs

index 0e06545300a4eee87a7333711ab8b2c04ae47a19..8fad0e01b7a9e131d17b77afb3a291d327925327 100644 (file)
@@ -396,7 +396,7 @@ fn rewrite_comment_inner(
 /// Returns true if the given string MAY include URLs or alike.
 fn has_url(s: &str) -> bool {
     // This function may return false positive, but should get its job done in most cases.
-    s.contains("https://") || s.contains("http://")
+    s.contains("https://") || s.contains("http://") || s.contains("ftp://") || s.contains("file://")
 }
 
 /// Given the span, rewrite the missing comment inside it if available.