User can use named anchor in FreeLinks in UseMod Wiki 1.0. But the appearance is not so good. You can write test code like this:
* [[WikiPatches/AnchorsInFreeLinkBugFix#bottom|Goto bottom]] * [[WikiPatches/AnchorsInFreeLinkBugFix#bottom]]
--- wiki.pl 2003-09-11 20:21:02.000000000 +0800 +++ wiki.pl.freelink 2003-11-16 22:36:36.468750000 +0800 @@ -301,9 +301,17 @@ $AnyLetter = "[-,.()' _0-9A-Za-z]"; } } - $FreeLinkPattern = "($AnyLetter+)"; + $FreeLinkPattern = "($AnyLetter+"; if ($UseSubpage) { - $FreeLinkPattern = "((?:(?:$AnyLetter+)?\\/)?$AnyLetter+)"; + $FreeLinkPattern = "((?:(?:$AnyLetter+)?\\/)?$AnyLetter+"; + } + if ($NamedAnchors) + { + $FreeLinkPattern .= "(?:#(?:\\w+))?)"; + } + else + { + $FreeLinkPattern .= ")"; } $FreeLinkPattern .= $QDelim; # Url-style links are delimited by one of: @@ -1157,6 +1165,7 @@ sub GetPageOrEditAnchoredLink { my ($id, $anchor, $name) = @_; my (@temp, $exists); + my $NamedFreeLink = 0; if ($name eq "") { $name = $id; @@ -1164,6 +1173,10 @@ $name =~ s/_/ /g; } } + else + { + $NamedFreeLink = 1; + } $id =~ s|^/|$MainPage/|; if ($FreeLinks) { $id = &FreeToNormal($id); @@ -1179,7 +1192,7 @@ } if ($exists) { $id = "$id#$anchor" if $anchor; - $name = "$name#$anchor" if $anchor && $NamedAnchors != 2; + $name = "$name#$anchor" if $anchor && $NamedAnchors != 2 && !$NamedFreeLink; return &GetPageLinkText($id, $name); } if ($FreeLinks && !$EditNameLink) { @@ -1196,7 +1209,8 @@ sub GetPageOrEditLink { my ($id, $name) = @_; - return &GetPageOrEditAnchoredLink($id, "", $name); + my ($link, $anchor) = split( /#/, $id, 2); + return &GetPageOrEditAnchoredLink($link, $anchor, $name); } sub GetBackLinksSearchLink {
-- Johnson