From: <Ste...@nt...> - 2006-02-06 20:08:26
|
Author: SteffenPoulsen Date: 2006-02-06 12:06:29 -0800 (Mon, 06 Feb 2006) New Revision: 8706 Modified: twiki/branches/DEVELOP/lib/TWiki/Render.pm Log: Item1592: Killing some never documented syntax, allowing for more flexibility in explicit external [[]]-style links Modified: twiki/branches/DEVELOP/lib/TWiki/Render.pm =================================================================== --- twiki/branches/DEVELOP/lib/TWiki/Render.pm 2006-02-06 17:50:22 UTC (rev 8705) +++ twiki/branches/DEVELOP/lib/TWiki/Render.pm 2006-02-06 20:06:29 UTC (rev 8706) @@ -664,20 +664,9 @@ # Spot full URLs if( $link =~ /^$TWiki::regex{linkProtocolPattern}\:/ || $link =~ /^\// ) { - # URL, absolute or relative - if ( $link =~ /^(\S+)\s+(.*)$/ ) { - # '[[URL#anchor display text]]' link: - $link = $1; - $text = $2; - } else { - # '[[Web.odd wiki word#anchor][display text]]' link: - # '[[Web.odd wiki word#anchor]]' link: - # External link: add <nop> before WikiWord and ABBREV - # inside link text, to prevent double links - # SMELL - why regex{upperAlpha} here - surely this is a web - # match, not a CAPWORD match? - $text =~ s/(?<=[\s\(])([$TWiki::regex{upperAlpha}])/<nop>$1/go; - } + # Prevent automatic WikiWord or CAPWORD linking in explicit links + $link =~ s/(?<=[\s\(])($TWiki::regex{wikiWordRegex}|[$TWiki::regex{upperAlpha}])/<nop>$1/go; + $text =~ s/(?<=[\s\(])($TWiki::regex{wikiWordRegex}|[$TWiki::regex{upperAlpha}])/<nop>$1/go; return $this->_externalLink( $link, $text ); } |