* [PATCH 2/2] view: actually omit subject text when dumping topics
2020-04-22 1:33 6% ` [PATCH 1/2] view: strip omission character from current message in thread view Kyle Meyer
@ 2020-04-22 1:33 6% ` Kyle Meyer
1 sibling, 0 replies; 5+ results
From: Kyle Meyer @ 2020-04-22 1:33 UTC (permalink / raw)
To: meta; +Cc: Kyle Meyer
Despite dump_topics() calling dedupe_subject() on the subject, the
index shows partly duplicated subjects, for example
` [PATCH 2/2] t/www_listing: avoid 'once' warnings
` [PATCH v2] t/www_listing: avoid 'once' warnings "
In the second line, the omission character " is appended, but the
entire subject is shown. To display the subject with duplicated parts
omitted, regenerate it from the array that is modified by
dedupe_subject().
---
lib/PublicInbox/View.pm | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index c90eaf6a..30928fdb 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -1096,6 +1096,7 @@ sub dump_topics {
my @next_prev = @subj; # full copy
my $omit = dedupe_subject($prev_subj, \@subj, ' "');
$prev_subj = \@next_prev;
+ $subj = join(' ', @subj);
$subj = ascii_html($subj);
obfuscate_addrs($obfs_ibx, $subj) if $obfs_ibx;
$href = mid_href($mid);
--
2.26.0
^ permalink raw reply related [relevance 6%]
* [PATCH 1/2] view: strip omission character from current message in thread view
@ 2020-04-22 1:33 6% ` Kyle Meyer
2020-04-22 1:33 6% ` [PATCH 2/2] view: actually omit subject text when dumping topics Kyle Meyer
1 sibling, 0 replies; 5+ results
From: Kyle Meyer @ 2020-04-22 1:33 UTC (permalink / raw)
To: meta; +Cc: Kyle Meyer
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.
---
lib/PublicInbox/View.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 9b62ed3c..c90eaf6a 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -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> (" )?!!s; # no point in duplicating subject
$attr =~ s!<a\nhref=[^>]+>([^<]+)</a>!$1!s; # no point linking to self
$rv .= "<b>@ $attr";
if ($nr_c) {
--
2.26.0
^ permalink raw reply related [relevance 6%]
* [PATCH v2] t/www_listing: avoid 'once' warnings
2020-03-21 1:10 7% ` [PATCH 2/2] t/www_listing: avoid 'once' warnings Eric Wong
@ 2020-03-21 5:24 7% ` Eric Wong
0 siblings, 0 replies; 5+ results
From: Eric Wong @ 2020-03-21 5:24 UTC (permalink / raw)
To: meta
We reach into the WwwListing package directly to retrieve
that JSON encoder/decoder object, and we can't rely on `use'
since WwwListing loading may fail if Plack is missing.
---
*sigh* v1 was wrong :x
t/www_listing.t | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/t/www_listing.t b/t/www_listing.t
index 39c19577..9230329c 100644
--- a/t/www_listing.t
+++ b/t/www_listing.t
@@ -9,8 +9,10 @@ use PublicInbox::TestCommon;
require_mods(qw(URI::Escape Plack::Builder Digest::SHA
IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny));
require PublicInbox::WwwListing;
-my $json = $PublicInbox::WwwListing::json or
- plan skip_all => "JSON module missing";
+my $json = do {
+ no warnings 'once';
+ $PublicInbox::WwwListing::json;
+} or plan skip_all => "JSON module missing";
use_ok 'PublicInbox::Git';
^ permalink raw reply related [relevance 7%]
* [PATCH 2/2] t/www_listing: avoid 'once' warnings
2020-03-21 1:10 5% ` [PATCH 0/2] wwwlisting: fixup warnings :x Eric Wong
@ 2020-03-21 1:10 7% ` Eric Wong
2020-03-21 5:24 7% ` [PATCH v2] " Eric Wong
0 siblings, 1 reply; 5+ results
From: Eric Wong @ 2020-03-21 1:10 UTC (permalink / raw)
To: meta
We reach into the WwwListing package directly to retrieve
that JSON encoder/decoder object, and we can't rely on `use'
since WwwListing loading may fail if Plack is missing.
---
t/www_listing.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/t/www_listing.t b/t/www_listing.t
index 39c19577..1b29dd88 100644
--- a/t/www_listing.t
+++ b/t/www_listing.t
@@ -8,7 +8,7 @@ use PublicInbox::Spawn qw(which);
use PublicInbox::TestCommon;
require_mods(qw(URI::Escape Plack::Builder Digest::SHA
IO::Compress::Gzip IO::Uncompress::Gunzip HTTP::Tiny));
-require PublicInbox::WwwListing;
+use PublicInbox::WwwListing;
my $json = $PublicInbox::WwwListing::json or
plan skip_all => "JSON module missing";
^ permalink raw reply related [relevance 7%]
* [PATCH 0/2] wwwlisting: fixup warnings :x
@ 2020-03-21 1:10 5% ` Eric Wong
2020-03-21 1:10 7% ` [PATCH 2/2] t/www_listing: avoid 'once' warnings Eric Wong
0 siblings, 1 reply; 5+ results
From: Eric Wong @ 2020-03-21 1:10 UTC (permalink / raw)
To: meta
I made tests run so quickly that I missed some warnings :x
Eric Wong (2):
wwwlisting: use first successfully loaded JSON module
t/www_listing: avoid 'once' warnings
lib/PublicInbox/WwwListing.pm | 2 +-
t/www_listing.t | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
^ permalink raw reply [relevance 5%]
Results 1-5 of 5 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-03-19 8:32 [PATCH 3/6] wwwlisting: avoid lazy loading JSON module Eric Wong
2020-03-21 1:10 5% ` [PATCH 0/2] wwwlisting: fixup warnings :x Eric Wong
2020-03-21 1:10 7% ` [PATCH 2/2] t/www_listing: avoid 'once' warnings Eric Wong
2020-03-21 5:24 7% ` [PATCH v2] " Eric Wong
2020-04-22 1:33 [PATCH 0/2] view: two display fixes for deduped subjects Kyle Meyer
2020-04-22 1:33 6% ` [PATCH 1/2] view: strip omission character from current message in thread view Kyle Meyer
2020-04-22 1:33 6% ` [PATCH 2/2] view: actually omit subject text when dumping topics Kyle Meyer
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).