I am setting up TWiki on an intranet Server and would like
to use Specific Links with relative URI like
[[/mirror/internic/rfc-index.html][RFC Index]].
To make this possible I modified
TWiki.pm. See appended patch.
Any comments?
===================================================================
RCS file: TWiki.pm,v
retrieving revision 1.1
diff -c -r1.1 TWiki.pm
*** TWiki.pm 2002/02/15 16:27:27 1.1
--- TWiki.pm 2002/02/15 16:36:17
***************
*** 1797,1804 ****
$theLink =~ s/^\s*//o;
$theLink =~ s/\s*$//o;
! if( $theLink =~ /^(http|ftp|gopher|news|file|https)\:/ ) {
! # found external link
return "$thePreamble<a href=\"$theLink\" target=\"_top\">$theText";
}
--- 1797,1804 ----
$theLink =~ s/^\s*//o;
$theLink =~ s/\s*$//o;
! if( $theLink =~ /^((http|ftp|gopher|news|file|https)\:)|\/\w/ ) {
! # found external or relative abs_path link
return "$thePreamble<a href=\"$theLink\" target=\"_top\">$theText";
}
--
WinfriedKoenig - 15 Feb 2002
Sounds like a useful enhancement. Any unwanted side effects?
--
PeterThoeny - 16 Feb 2002
This does look useful. If this is going into the core code, could we also consider the
EasierExternalLinking feature, which makes it possible to link to URLs using something like this:
[[http://example.com click here]] or
[[/path/to/some/file click here]] - i.e. it avoids the hard-to-type
][ combination in the middle. We've been using this on our local TWiki for some months now and it works well.
--
RichardDonkin - 16 Feb 2002
I support
RichardDonkin: URL cannot contain space, so we can use space to separate URL from text of the link inside [[]]. Users will appreciate this, and I hope it is simple change.
--
PeterMasiar - 19 Feb 2002