Subject: | Support [[title]] and [[text|title]] links in addition to full-URL ones |
Links to pages within the Wiki should be in the form [[title]] or
[[text|title]] rather than via full URL.
Patch here:
https://github.com/lorrin/HTML-WikiConverter-MoinMoin/commit/ebb155f8878fbf9cf69236bb8429dfe0f712cb0b
@@ -166,8 +166,13 @@ sub _link {
$url = $self->_abs2rel($url);
}
- return $url if $url eq $text;
- return "[[$url|$text]]";
+ if( my $title = $self->get_wiki_page($url) ) {
+ return "[[$text]]" if $text eq $title;
+ return "[[$title|$text]]";
+ } else {
+ return $url if $url eq $text;
+ return "[[$url|$text]]";
+ }
}
sub _abs2rel {