Feature #10408

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

Added by David Busby over 10 years ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-
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!

Also available in: Atom PDF