X-Git-Url: https://git.shemshak.org/~bandali/bndl.org/blobdiff_plain/195800798b1ac75491044d211db2f000cbbe86da..212ec2e606552fdfa9fcd970a5e27a7dc9ce0042:/txt2html diff --git a/txt2html b/txt2html index b26b202..e6dc30b 100644 --- a/txt2html +++ b/txt2html @@ -96,6 +96,7 @@ sub linkify { my $txt = do { local $/; }; + my $title = html_esc($txt =~ /\A([^\n]+)/); $title =~ s/^\s+|\s+$//g; if ($opt_lang eq 'fa') { @@ -103,7 +104,11 @@ if ($opt_lang eq 'fa') { } else { $title .= ' — bandali' if $title !~ /bandali/; } -my ($url) = $txt =~ /(?:plain text|متن ساده): (.*)\r?\n?\z/; + +my ($upd, $pub, $url) = $txt =~ /(.*)\r?\n(.*)\r?\n(.*)\r?\n?\z/; +($upd) = $upd =~ /(?:updated|ویرایش): (.*)/ if $upd; +($pub) = $pub =~ /(?:published|انتشار): (.*)/ if $pub; +($url) = $url =~ /(?:plain text|متن ساده): (.*)/ if $url; $url = 'https://bndl.org/bandali-cv.txt' if (!$url and $title =~ /curriculum vitae/); $url = html_esc($url) if $url; @@ -118,6 +123,7 @@ print("", \n), "$title\n", + qq(\n), $url ? qq(\n) : '', ($opt_index and $opt_lang eq 'en')