$content =~ s{(\\?)$config{wiki_link_regexp}}{
defined $2
? ( $1
- ? "[[$2|$3".(length $4 ? "#$4" : "")."]]"
+ ? "[[$2|$3".($4 ? "#$4" : "")."]]"
: htmllink($lpage, $page, linkpage($3),
anchor => $4, linktext => pagetitle($2)))
: ( $1
- ? "[[$3".(length $4 ? "#$4" : "")."]]"
+ ? "[[$3".($4 ? "#$4" : "")."]]"
: htmllink($lpage, $page, linkpage($3),
anchor => $4))
}eg;