--- test/html-webhacc/WebHACC/Output.pm 2008/07/20 14:58:24 1.1 +++ test/html-webhacc/WebHACC/Output.pm 2008/07/20 16:53:10 1.2 @@ -119,7 +119,7 @@ sub link ($$%) { my ($self, $content, %opt) = @_; - $self->html (''); + $self->start_tag ('a', %opt, href => $opt{url}); $self->text ($content); $self->html (''); } # link @@ -131,6 +131,12 @@ $self->html (''); } # xref +sub link_to_webhacc ($$%) { + my ($self, $content, %opt) = @_; + $opt{url} = './?uri=' . $self->encode_url_component ($opt{url}); + $self->link ($content, %opt); +} # link_to_webhacc + sub nav_list ($) { my $self = shift; $self->html (q[
'); } # nav_list + +sub encode_url_component ($$) { + shift; + require Encode; + my $s = Encode::encode ('utf8', shift); + $s =~ s/([^0-9A-Za-z_.~-])/sprintf '%%%02X', ord $1/ge; + return $s; +} # encode_url_component + 1;