user/dev discussion of public-inbox itself
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [PATCH 2/8] view: single id="t" for multi-Subject messages
  2020-02-15  9:46  5% [PATCH 0/8] some view cleanups and minor bugfixes Eric Wong
@ 2020-02-15  9:46  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2020-02-15  9:46 UTC (permalink / raw)
  To: meta

While multi-Subject messages are unfortunate, try not to
generate confusing/invalid HTML with multiple elements
having the same HTML id attribute.
---
 lib/PublicInbox/View.pm | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index dcaee1ae..45c191db 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -651,16 +651,15 @@ sub _msg_page_prepare_obuf {
 	}
 	my @subj = $hdr->header('Subject');
 	if (@subj) {
-		for my $v (@subj) {
+		my $v = ascii_html(shift @subj);
+		obfuscate_addrs($obfs_ibx, $v) if $obfs_ibx;
+		$rv .= 'Subject: ';
+		$rv .= $over ? qq(<a\nhref="#r"\nid=t>$v</a>\n) : "$v\n";
+		$title[0] = $v;
+		for $v (@subj) { # multi-Subject message :<
 			$v = ascii_html($v);
 			obfuscate_addrs($obfs_ibx, $v) if $obfs_ibx;
-			$rv .= 'Subject: ';
-			if ($over) {
-				$rv .= qq(<a\nhref="#r"\nid=t>$v</a>\n);
-			} else {
-				$rv .= "$v\n";
-			}
-			$title[0] //= $v;
+			$rv .= "Subject: $v\n";
 		}
 	} else { # dummy anchor for thread skeleton at bottom of page
 		$rv .= qq(<a\nhref="#r"\nid=t></a>) if $over;

^ permalink raw reply related	[relevance 7%]

* [PATCH 0/8] some view cleanups and minor bugfixes
@ 2020-02-15  9:46  5% Eric Wong
  2020-02-15  9:46  7% ` [PATCH 2/8] view: single id="t" for multi-Subject messages Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2020-02-15  9:46 UTC (permalink / raw)
  To: meta

Pretty insignificant, but the diffstat makes me happy :>

Eric Wong (8):
  view: remove mhref arg from multipart_text_as_html
  view: single id="t" for multi-Subject messages
  view: dump_topics: better naming of top Subject
  view: cleanup topic accumulation and dumping
  view,searchview: avoid smsg method calls when using SQLite/Xapian
  view: escape Subject HTML directly
  view: escape ampersand in Message-IDs
  view: remove last Hval->new caller

 lib/PublicInbox/ExtMsg.pm        |  19 ++--
 lib/PublicInbox/Hval.pm          |  28 +-----
 lib/PublicInbox/Linkify.pm       |   9 +-
 lib/PublicInbox/Reply.pm         |   6 +-
 lib/PublicInbox/SearchView.pm    |  10 +--
 lib/PublicInbox/View.pm          | 144 ++++++++++++++-----------------
 lib/PublicInbox/WwwAtomStream.pm |  12 +--
 t/psgi_bad_mids.t                |   9 +-
 xt/perf-msgview.t                |   3 +-
 9 files changed, 104 insertions(+), 136 deletions(-)

^ permalink raw reply	[relevance 5%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2020-02-15  9:46  5% [PATCH 0/8] some view cleanups and minor bugfixes Eric Wong
2020-02-15  9:46  7% ` [PATCH 2/8] view: single id="t" for multi-Subject messages Eric Wong

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).