Index: lib/TWiki/Render.pm
===================================================================
RCS file: /e/www/CVS/twiki-cairo/lib/TWiki/Render.pm,v
retrieving revision 1.3
diff -c -r1.3 Render.pm
*** lib/TWiki/Render.pm 30 Jan 2005 02:43:04 -0000 1.3
--- lib/TWiki/Render.pm 11 Feb 2005 05:25:10 -0000
***************
*** 590,596 ****
=cut
sub internalLink {
! my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink, $doKeepWeb ) = @_;
# $thePreamble is text used before the TWiki link syntax
# $doLink is boolean: false means suppress link for non-existing pages
# $doKeepWeb is boolean: true to keep web prefix (for non existing Web.TOPIC)
--- 589,595 ----
=cut
sub internalLink {
! my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink, $doKeepWeb, $addTranslationToken ) = @_;
# $thePreamble is text used before the TWiki link syntax
# $doLink is boolean: false means suppress link for non-existing pages
# $doKeepWeb is boolean: true to keep web prefix (for non existing Web.TOPIC)
***************
*** 643,670 ****
$text .= "$theLinkText";
return $text;
} else {
$text .= "$theLinkText";
return $text;
}
} elsif( $doLink ) {
$text .= ""
! . "$theLinkText"
. "$newLinkSymbol";
return $text;
} elsif( $doKeepWeb ) {
! $text .= "$theWeb.$theLinkText";
return $text;
} else {
! $text .= $theLinkText;
return $text;
}
}
--- 642,669 ----
$text .= "$TranslationToken$theLinkText$TranslationToken":">$theLinkText";
return $text;
} else {
$text .= "$TranslationToken$theLinkText$TranslationToken":">$theLinkText");
return $text;
}
} elsif( $doLink ) {
$text .= ""
! . ($addTranslationToken?"$TranslationToken$theLinkText$TranslationToken":"$theLinkText")
. "$newLinkSymbol";
return $text;
} elsif( $doKeepWeb ) {
! $text .= ($addTranslationToken?"$theWeb.$TranslationToken$theLinkText$TranslationToken":"$theWeb.$theLinkText");
return $text;
} else {
! $text .= ($addTranslationToken?"$TranslationToken$theLinkText$TranslationToken":$theLinkText);
return $text;
}
}
***************
*** 680,690 ****
sub internalCrosswebLink
{
! my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink ) = @_;
if ( $theTopic eq $TWiki::mainTopicname && $theWeb ne $TWiki::webName ) {
! return internalLink( $thePreamble, $theWeb, $theTopic, $theWeb, $theAnchor, $doLink );
} else {
! return internalLink( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink );
}
}
--- 679,689 ----
sub internalCrosswebLink
{
! my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink, $addToken ) = @_;
if ( $theTopic eq $TWiki::mainTopicname && $theWeb ne $TWiki::webName ) {
! return internalLink( $thePreamble, $theWeb, $theTopic, $theWeb, $theAnchor, $doLink, "", $addToken );
} else {
! return internalLink( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink, "", $addToken );
}
}
***************
*** 1110,1121 ****
unless( $noAutoLink || $insideNoAutoLink ) {
# 'Web.TopicName#anchor' link:
! s/([\s\(])($regex{webNameRegex})\.($regex{wikiWordRegex})($regex{anchorRegex})/&internalLink($1,$2,$3,"$TranslationToken$3$4$TranslationToken",$4,1)/geo;
# 'Web.TopicName' link:
! s/([\s\(])($regex{webNameRegex})\.($regex{wikiWordRegex})/&internalCrosswebLink($1,$2,$3,"$TranslationToken$3$TranslationToken","",1)/geo;
# 'TopicName#anchor' link:
! s/([\s\(])($regex{wikiWordRegex})($regex{anchorRegex})/&internalLink($1,$theWeb,$2,"$TranslationToken$2$3$TranslationToken",$3,1)/geo;
# 'TopicName' link:
s/([\s\(])($regex{wikiWordRegex})/&internalLink($1,$theWeb,$2,$2,"",1)/geo;
--- 1109,1120 ----
unless( $noAutoLink || $insideNoAutoLink ) {
# 'Web.TopicName#anchor' link:
! s/([\s\(])($regex{webNameRegex})\.($regex{wikiWordRegex})($regex{anchorRegex})/&internalLink($1,$2,$3,"$3$4",$4,1,1)/geo;
# 'Web.TopicName' link:
! s/([\s\(])($regex{webNameRegex})\.($regex{wikiWordRegex})/&internalCrosswebLink($1,$2,$3,$3,"",1,1)/geo;
# 'TopicName#anchor' link:
! s/([\s\(])($regex{wikiWordRegex})($regex{anchorRegex})/&internalLink($1,$theWeb,$2,"$2$3",$3,1,1)/geo;
# 'TopicName' link:
s/([\s\(])($regex{wikiWordRegex})/&internalLink($1,$theWeb,$2,$2,"",1)/geo;