Use issue tracker for ncdu + fixed a few minor bugs
This commit is contained in:
parent
605b0643d3
commit
05c36a1aef
3 changed files with 25 additions and 10 deletions
16
Issue.pm
16
Issue.pm
|
|
@ -45,6 +45,7 @@ sub dbListing {
|
|||
my %o = (
|
||||
results => 100,
|
||||
page => 1,
|
||||
@_
|
||||
);
|
||||
$o{reverse} = 1 if !$o{sort};
|
||||
|
||||
|
|
@ -122,6 +123,18 @@ sub htmlListing {
|
|||
}
|
||||
|
||||
|
||||
sub _escape_url {
|
||||
my $str = shift;
|
||||
my $r = '';
|
||||
my $last = 0;
|
||||
while($str =~ m{((?:https?|ftp)://[^ ><"\n\s]+[\d\w=/-])}g) {
|
||||
$r .= sprintf '%s<a href="%s">%2$s</a>', html_escape(substr $str, $last, (pos($str)-length($1))-$last), html_escape($1);
|
||||
$last = pos $str;
|
||||
}
|
||||
return $r.html_escape(substr $str, $last);
|
||||
}
|
||||
|
||||
|
||||
sub htmlItem {
|
||||
my($s, $d) = @_;
|
||||
my $last = $d->[$#$d];
|
||||
|
|
@ -149,8 +162,7 @@ sub htmlItem {
|
|||
dd sprintf '"%s" to "%s"', $d->[$num-1]{closed}?'yes':'no', $m->{closed}?'yes':'no';
|
||||
}
|
||||
end;
|
||||
# TODO: link formatting and some way to link to other issues
|
||||
p; lit html_escape $m->{message}; end;
|
||||
p; lit _escape_url $m->{message}; end;
|
||||
end;
|
||||
}
|
||||
end;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue