From 0bcf715b7ef1e51bf05eeb46b066be8a762e13aa Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 9 Jan 2016 09:45:20 +0000 Subject: hval: use more appropriate hvals for documentation Not needed, but this is good documentation. Some of these values should never have newlines. --- lib/PublicInbox/ExtMsg.pm | 2 +- lib/PublicInbox/SearchView.pm | 2 +- lib/PublicInbox/View.pm | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm index a56df335..98da45cc 100644 --- a/lib/PublicInbox/ExtMsg.pm +++ b/lib/PublicInbox/ExtMsg.pm @@ -124,7 +124,7 @@ again: foreach my $pfx (@partial) { my $u = $pfx->{url}; foreach my $m (@{$pfx->{res}}) { - my $p = PublicInbox::Hval->new($m); + my $p = PublicInbox::Hval->new_msgid($m); my $r = $p->as_href; my $t = $p->as_html; $s .= qq{$u/$t/\n}; diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index b3ddcb54..8f61b4f4 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -288,7 +288,7 @@ sub qs_html { $self = $tmp; } - my $q = PublicInbox::Hval->new($self->{q})->as_href; + my $q = PublicInbox::Hval->new_oneline($self->{q})->as_href; $q =~ s/%20/+/g; # improve URL readability my $qs = "q=$q"; diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm index 4fc8ffc3..829806d8 100644 --- a/lib/PublicInbox/View.pm +++ b/lib/PublicInbox/View.pm @@ -768,8 +768,8 @@ sub _inline_header { my $mid = mid_clean($mime->header('Message-ID')); my $f = $mime->header('X-PI-From'); my $d = _msg_date($mime); - $f = PublicInbox::Hval->new($f)->as_html; - $d = PublicInbox::Hval->new($d)->as_html; + $f = PublicInbox::Hval->new_oneline($f)->as_html; + $d = PublicInbox::Hval->new_oneline($d)->as_html; my $pfx = ' ' . $d . ' ' . indent_for($level); my $attr = $f; $state->{first_level} ||= $level; @@ -902,7 +902,7 @@ sub dump_topics { my ($level, $subj, $topic) = @$info; my $n = delete $subjs->{$topic}; my ($mid, $ts) = @{delete $latest->{$topic}}; - $mid = PublicInbox::Hval->new($mid)->as_href; + $mid = PublicInbox::Hval->new_msgid($mid)->as_href; $subj = PublicInbox::Hval->new($subj)->as_html; $pfx = indent_for($level); my $nl = $level == $prev ? "\n" : ''; -- cgit v1.2.3-24-ge0c7