]> Sergey Matveev's repositories - public-inbox.git/commitdiff
view: strip omission character from current message in thread view
authorKyle Meyer <kyle@kyleam.com>
Wed, 22 Apr 2020 01:33:58 +0000 (21:33 -0400)
committerEric Wong <e@yhbt.net>
Wed, 22 Apr 2020 07:02:27 +0000 (07:02 +0000)
In the thread view shown at the top of a message, the subject for the
current message is dropped, leaving just the sender's name.  However,
if skel_dump() omitted part of the subject because it was duplicated,
the omission character is still displayed:

  * [PATCH v2] t/www_listing: avoid 'once' warnings
    2020-03-21  1:10 ` [PATCH 2/2] t/www_listing: avoid 'once' warnings Eric Wong
  @ 2020-03-21  5:24   ` " Eric Wong

Note the " on the last line.

Adjust the regular expression in _th_index_lite() to account for the
omission character.

[ew: avoid capturing $1, keep under 80 cols]

lib/PublicInbox/View.pm

index 9b62ed3c3d954d76ab173c4c32bd561b85c62b30..280d0ea5557024a790012d2bf0ab1e2d950f014b 100644 (file)
@@ -322,7 +322,7 @@ sub _th_index_lite {
        my $s_s = nr_to_s($nr_s, 'sibling', 'siblings');
        my $s_c = nr_to_s($nr_c, 'reply', 'replies');
        $attr =~ s!\n\z!</b>\n!s;
-       $attr =~ s!<a\nhref.*</a> !!s; # no point in duplicating subject
+       $attr =~ s!<a\nhref.*</a> (?:&#34; )?!!s; # no point in dup subject
        $attr =~ s!<a\nhref=[^>]+>([^<]+)</a>!$1!s; # no point linking to self
        $rv .= "<b>@ $attr";
        if ($nr_c) {