Project

General

Profile

Actions

Feature #10408

open

Support More Hyperlink Protocols in the Wiki Formatter (textile/formatter.rb)

Added by David Busby over 12 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

The wiki formatter, while awesome, only supports a few protocols for the auto linking (AUTO_LINK_RE).
So, I made this little hack to get it to support almost anything
This in-line patch is against 1.3.0 and hasn't crashed mine (yet!) :0


--- formatter.rb.orig    2012-03-08 10:03:52.000000000 -0800
+++ formatter.rb    2012-03-08 10:04:06.000000000 -0800
@@ -132,9 +132,8 @@
                           ^                        # beginning of line
                         )
                         (
-                          (?:https?://)|           # protocol spec, or
-                          (?:s?ftps?://)|
                           (?:www\.)                # www.*
+                          (?:\w{3,6}://)           # Almost anything ssh, vnc, http, https, mailto, ics, tel, sip, foo, beer, monkey
                         )
                         (
                           (\S+?)                   # url

Thanks for awesome software!

No data to display

Actions

Also available in: Atom PDF