From: Peter T. <pet...@us...> - 2004-04-25 20:17:37
|
Update of /cvsroot/twiki/twiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7405 Modified Files: TWiki.pm Log Message: Fix for Codev.IncludeFromOtherWebLinksACRONYMS Index: TWiki.pm =================================================================== RCS file: /cvsroot/twiki/twiki/lib/TWiki.pm,v retrieving revision 1.329 retrieving revision 1.330 diff -C2 -r1.329 -r1.330 *** TWiki.pm 25 Apr 2004 00:57:32 -0000 1.329 --- TWiki.pm 25 Apr 2004 06:01:45 -0000 1.330 *************** *** 2040,2044 **** # "TopicName" to "Web.TopicName" $text =~ s/(^|[\s\(])($regex{webNameRegex}\.$regex{wikiWordRegex})/$1$TranslationToken$2/go; - $text =~ s/(^|[\s\(])($regex{wikiWordRegex}|$regex{abbrevRegex})/$1$theWeb\.$2/go; $text =~ s/(^|[\s\(])$TranslationToken/$1/go; # "[[TopicName]]" to "[[Web.TopicName][TopicName]]" --- 2040,2043 ---- *************** *** 3556,3560 **** =pod ! ---++ sub internalLink ( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink ) Not yet documented. --- 3555,3559 ---- =pod ! ---++ sub internalLink ( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink, $doKeepWeb ) Not yet documented. *************** *** 3563,3569 **** sub internalLink { ! my( $thePreamble, $theWeb, $theTopic, $theLinkText, $theAnchor, $doLink ) = @_; # $thePreamble is text used before the TWiki link syntax # $doLink is boolean: false means suppress link for non-existing pages # Get rid of leading/trailing spaces in topic name --- 3562,3569 ---- 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) # Get rid of leading/trailing spaces in topic name *************** *** 3626,3629 **** --- 3626,3633 ---- return $text; + } elsif( $doKeepWeb ) { + $text .= "$theWeb.$theLinkText"; + return $text; + } else { $text .= $theLinkText; *************** *** 4058,4062 **** # Handle acronyms/abbreviations of three or more letters # 'Web.ABBREV' link: ! s/([\s\(])($regex{webNameRegex})\.($regex{abbrevRegex})/&internalLink($1,$2,$3,$3,"",0)/geo; # 'ABBREV' link: s/([\s\(])($regex{abbrevRegex})/&internalLink($1,$theWeb,$2,$2,"",0)/geo; --- 4062,4066 ---- # Handle acronyms/abbreviations of three or more letters # 'Web.ABBREV' link: ! s/([\s\(])($regex{webNameRegex})\.($regex{abbrevRegex})/&internalLink($1,$2,$3,$3,"",0,1)/geo; # 'ABBREV' link: s/([\s\(])($regex{abbrevRegex})/&internalLink($1,$theWeb,$2,$2,"",0)/geo; |