Feature #1514

Parsing ftp URL

Added by Stanislav German-Evtushenko over 9 years ago. Updated almost 9 years ago.

Status:ClosedStart date:2008-06-22
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Wiki
Target version:0.8
Resolution:Fixed

Description

Patch Redmine 0.7.1 for Parsing ftp URLs

Index: lib/redmine/wiki_formatting.rb
===================================================================
--- lib/redmine/wiki_formatting.rb    (revision 1496)
+++ lib/redmine/wiki_formatting.rb    (working copy)
@@ -126,6 +126,7 @@
                         )
                         (
                           (?:https?://)|           # protocol spec, or
+                          (?:ftp://)|              # 
                           (?:www\.)                # www.*
                         )
                         (

Associated revisions

Revision 1577
Added by Jean-Philippe Lang over 9 years ago

Turn ftp urls into links (#1514).

Revision 2018
Added by Jean-Philippe Lang almost 9 years ago

Turn ftps and sftp proto into links (#1514).

History

#1 Updated by Jean-Philippe Lang over 9 years ago

  • Category set to Wiki
  • Status changed from New to Closed
  • Target version set to 0.8
  • Resolution set to Fixed

Applied in r1577.

#2 Updated by Kevin Light over 9 years ago

  • Status changed from Closed to Reopened

I think the regex for parsing ftp:// links is a bit too aggressive as it tears apart sftp:// links.

The less aggressive approach would be to watch for whitespace before the ftp:// so the patch should be:

Index: lib/redmine/wiki_formatting.rb
===================================================================
--- lib/redmine/wiki_formatting.rb    (revision 1496)
+++ lib/redmine/wiki_formatting.rb    (working copy)
@@ -126,6 +126,7 @@
                         )
                         (
                           (?:https?://)|           # protocol spec, or
+                          (?:\sftp://)|            # 
                           (?:www\.)                # www.*
                         )
                         (

#3 Updated by Stanislav German-Evtushenko over 9 years ago

Kevin Light wrote:

I think the regex for parsing ftp:// links is a bit too aggressive as it tears apart sftp:// links.

The less aggressive approach would be to watch for whitespace before the ftp:// so the patch should be:

[...]

You can use "inline code" to disable parsing. For example: sftp://myserv

#4 Updated by Jean-Philippe Lang almost 9 years ago

  • Status changed from Reopened to Closed

sftp and ftps proto are now properly turned into links (r2018).

Also available in: Atom PDF