*** TWiki.pm.orig Fri Oct 18 16:37:44 2002 --- TWiki.pm Fri Oct 18 16:48:14 2002 *************** *** 1756,1761 **** --- 1756,1772 ---- } # ========================= + 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 ) = @_; *************** *** 2066,2072 **** # 'Web.TopicName#anchor' link: s/([\s\(])([A-Z]+[a-z0-9]*)\.([A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*)(\#[a-zA-Z0-9_]*)/&internalLink($1,$2,$3,"$TranslationToken$3$4$TranslationToken",$4,1)/geo; # 'Web.TopicName' link: ! s/([\s\(])([A-Z]+[a-z0-9]*)\.([A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*)/&internalLink($1,$2,$3,"$TranslationToken$3$TranslationToken","",1)/geo; # 'TopicName#anchor' link: s/([\s\(])([A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*)(\#[a-zA-Z0-9_]*)/&internalLink($1,$theWeb,$2,"$TranslationToken$2$3$TranslationToken",$3,1)/geo; # 'TopicName' link: --- 2077,2083 ---- # 'Web.TopicName#anchor' link: s/([\s\(])([A-Z]+[a-z0-9]*)\.([A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*)(\#[a-zA-Z0-9_]*)/&internalLink($1,$2,$3,"$TranslationToken$3$4$TranslationToken",$4,1)/geo; # 'Web.TopicName' link: ! s/([\s\(])([A-Z]+[a-z0-9]*)\.([A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*)/&internalCrosswebLink($1,$2,$3,"$TranslationToken$3$TranslationToken","",1)/geo; # 'TopicName#anchor' link: s/([\s\(])([A-Z]+[a-z]+[A-Z]+[a-zA-Z0-9]*)(\#[a-zA-Z0-9_]*)/&internalLink($1,$theWeb,$2,"$TranslationToken$2$3$TranslationToken",$3,1)/geo; # 'TopicName' link: