]> Sergey Matveev's repositories - public-inbox.git/blobdiff - Documentation/txt2pre
txt2pre: allow overriding title via env
[public-inbox.git] / Documentation / txt2pre
index 72de0b795567343bde80febc9e5bc90911ef61b9..2f1799fc15e70d42f416a16500a80b5f9d14a457 100755 (executable)
@@ -11,7 +11,8 @@ use PublicInbox::Linkify;
 use PublicInbox::Hval qw(ascii_html);
 
 my $str = eval { local $/; <> };
-my ($title) = ($str =~ /\A([^\n]+)/);
+my $title = $ENV{TITLE};
+($title) = ($str =~ /\A([^\n]+)/) unless $title;
 $title = ascii_html($title);
 my $l = PublicInbox::Linkify->new;
 $str = $l->linkify_1($str);