From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH 2/1] view: do not introduce excessive </pre> in $MID/t/ view
Date: Sat, 6 Aug 2016 00:30:41 +0000 [thread overview]
Message-ID: <20160806003041.GA6028@dcvr> (raw)
In-Reply-To: <20160805181459.24420-1-e@80x24.org>
When using <ul><li>..., we already setup <pre> tags
in thread_index_entry, so having an extra </pre> tag
causes validation errors.
Fixes: 6ef9b216156c ("view: use <hr> to delineate in /$MID/T/ view")
---
lib/PublicInbox/View.pm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index e150a01..d6711d5 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -164,13 +164,17 @@ sub index_entry {
"<a\nhref=\"$mhref\">permalink</a>" .
" <a\nhref=\"${mhref}raw\">raw</a>" .
" <a\nhref=\"${mhref}#R\">reply</a>";
+
+ my $hr;
if (my $pct = $ctx->{pct}) { # used by SearchView.pm
$rv .= "\t[relevance $pct->{$mid_raw}%]";
+ $hr = 1;
} elsif ($mapping) {
my $threaded = 'threaded';
my $flat = 'flat';
my $end = '';
if ($ctx->{flat}) {
+ $hr = 1;
$flat = "<b>$flat</b>";
} else {
$threaded = "<b>$threaded</b>";
@@ -180,7 +184,8 @@ sub index_entry {
$rv .= " <a\nhref=#r$id>$ctx->{s_nr}</a>";
}
- $rv .= $more ? '</pre><hr><pre>' : '</pre>';
+ $rv .= $more ? '</pre><hr><pre>' : '</pre>' if $hr;
+ $rv;
}
sub pad_link ($$;$) {
--
EW
next prev parent reply other threads:[~2016-08-06 0:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-05 18:14 [PATCH] view: use <hr> to delineate in /$MID/T/ view Eric Wong
2016-08-06 0:30 ` Eric Wong [this message]
2016-08-06 21:09 ` [PATCH] www: use <hr> to delimit messages in /new.html view, too 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=20160806003041.GA6028@dcvr \
--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).