Otherwise, there's no reason to use this API over highlight(1).
Maybe this can be an option in the future; but I'm struggling to
find a reason to not do it by default.
use bytes (); # only for bytes::length
use HTTP::Status qw(status_message);
use parent qw(PublicInbox::HlMod);
use bytes (); # only for bytes::length
use HTTP::Status qw(status_message);
use parent qw(PublicInbox::HlMod);
+use PublicInbox::Linkify qw();
# TODO: support highlight(1) for distros which don't package the
# SWIG extension. Also, there may be admins who don't want to
# TODO: support highlight(1) for distros which don't package the
# SWIG extension. Also, there may be admins who don't want to
return r(405) if $req_method ne 'PUT';
my $bref = read_in_full($env) or return r(500);
return r(405) if $req_method ne 'PUT';
my $bref = read_in_full($env) or return r(500);
+ my $l = PublicInbox::Linkify->new;
+ $l->linkify_1($$bref);
$bref = $self->do_hl($bref, $env->{PATH_INFO});
$bref = $self->do_hl($bref, $env->{PATH_INFO});
my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ];
push @$h, 'Content-Length', bytes::length($$bref);
my $h = [ 'Content-Type', 'text/html; charset=UTF-8' ];
push @$h, 'Content-Length', bytes::length($$bref);