From: Eric Wong Date: Sat, 15 Feb 2020 09:46:34 +0000 (+0000) Subject: view: single id="t" for multi-Subject messages X-Git-Tag: v1.4.0~117 X-Git-Url: http://www.git.stargrave.org/?a=commitdiff_plain;h=79587ed2cfa012137712508fd7e7f657fab75087;hp=aa0e67e63e58e0ee4fc3918bde25b9c04d48954a;p=public-inbox.git view: single id="t" for multi-Subject messages While multi-Subject messages are unfortunate, try not to generate confusing/invalid HTML with multiple elements having the same HTML id attribute. --- 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($v\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($v\n); - } else { - $rv .= "$v\n"; - } - $title[0] //= $v; + $rv .= "Subject: $v\n"; } } else { # dummy anchor for thread skeleton at bottom of page $rv .= qq() if $over;