*** lib/TWiki.pm.orig Tue Mar 4 17:09:37 2003 --- lib/TWiki.pm Tue Mar 4 17:12:08 2003 *************** *** 2324,2329 **** --- 2324,2340 ---- } # ========================= + sub internalCrosswebLink + { + my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink ) = @_; + if ( $theTopic eq $mainTopicname && $theWeb ne $webName ) { + return &internalLink($thePreamble, $theWeb, $theTopic, $theWeb, $theAnchor, $doLink); + } else { + return &internalLink($thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink); + } + } + + # ========================= sub internalLink { my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink ) = @_; # $thePreamble is text used before the TWiki link syntax *************** *** 2668,2674 **** # 'Web.TopicName#anchor' link: s/([\s\(])($webNameRegex)\.($wikiWordRegex)($anchorRegex)/&internalLink($1,$2,$3,"$TranslationToken$3$4$TranslationToken",$4,1)/geo; # 'Web.TopicName' link: ! s/([\s\(])($webNameRegex)\.($wikiWordRegex)/&internalLink($1,$2,$3,"$TranslationToken$3$TranslationToken","",1)/geo; # 'TopicName#anchor' link: s/([\s\(])($wikiWordRegex)($anchorRegex)/&internalLink($1,$theWeb,$2,"$TranslationToken$2$3$TranslationToken",$3,1)/geo; --- 2679,2685 ---- # 'Web.TopicName#anchor' link: s/([\s\(])($webNameRegex)\.($wikiWordRegex)($anchorRegex)/&internalLink($1,$2,$3,"$TranslationToken$3$4$TranslationToken",$4,1)/geo; # 'Web.TopicName' link: ! s/([\s\(])($webNameRegex)\.($wikiWordRegex)/&internalCrosswebLink($1,$2,$3,"$TranslationToken$3$TranslationToken","",1)/geo; # 'TopicName#anchor' link: s/([\s\(])($wikiWordRegex)($anchorRegex)/&internalLink($1,$theWeb,$2,"$TranslationToken$2$3$TranslationToken",$3,1)/geo;