X-Git-Url: https://git.shemshak.org/~bandali/bndl.org/blobdiff_plain/22e69f338295b2ab3ab7386ec7933c54ac104eb4..2e54355170923a0479ca86bae87b5e698ca61931:/txt2pre diff --git a/txt2pre b/txt2pre index 5bf8811..1f04eb4 100644 --- a/txt2pre +++ b/txt2pre @@ -195,11 +195,12 @@ my $txt = do { local $/; }; my $title = html_esc($txt =~ /\A([^\n]+)/); $title =~ s/^\s+|\s+$//g; -$title .= " — $author" if $title !~ /$author/; +$title .= " — $author" if $title !~ /$author/; my ($upd, $pub, $url) = $txt =~ /(.*)\r?\n(.*)\r?\n(.*)\r?\n?\z/; ($upd) = $upd =~ /(?:updated|ویرایش): (.*)/ if $upd; ($pub) = $pub =~ /(?:published|انتشار): (.*)/ if $pub; +$upd = $pub if (!$upd); ($url) = $url =~ /(?:plain text|متن ساده): (.*)/ if $url; $url = 'https://bndl.org/bandali-cv.txt' if (!$url and $title =~ /curriculum vitae/); @@ -272,7 +273,7 @@ qq( $url_html $note_id $pub_rfc5322\n) -. ($updated ? $updated : '') . +. (($updated and $pub ne $upd) ? $updated : '') . qq() : ''; }