From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 1/3] hval: use more appropriate hvals for documentation
Date: Sat, 9 Jan 2016 09:45:20 +0000 [thread overview]
Message-ID: <20160109094522.2484-2-e@80x24.org> (raw)
In-Reply-To: <20160109094522.2484-1-e@80x24.org>
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(-)
diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm
index a56df33..98da45c 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{<a\nhref="$u/$r/">$u/$t/</a>\n};
diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm
index b3ddcb5..8f61b4f 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 4fc8ffc..829806d 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" : '';
--
EW
next prev parent reply other threads:[~2016-01-09 9:45 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-09 9:45 [PATCH 0/3] a few minor small fixes Eric Wong
2016-01-09 9:45 ` Eric Wong [this message]
2016-01-09 9:45 ` [PATCH 2/3] hval: new should not strip leading spaces Eric Wong
2016-01-09 9:45 ` [PATCH 3/3] view: fix Atom feed link in full message view page Eric Wong
2016-01-09 10:55 ` [PATCH 4/3] www: fix redirection loops Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160109094522.2484-2-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).