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 4/4] view: fix broken hunk header hrefs in Atom feeds
  2019-02-01  8:55  6% [PATCH 0/4] viewvcs: Atom bugfix + diffstat anchors Eric Wong
@ 2019-02-01  8:55  7% ` Eric Wong
  0 siblings, 0 replies; 2+ results
From: Eric Wong @ 2019-02-01  8:55 UTC (permalink / raw)
  To: meta

We use absolute URLs in the Atom feeds (to ease
syndication/mirroring), so hunk headers need to point to the
solver URLs.
---
 lib/PublicInbox/View.pm | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/lib/PublicInbox/View.pm b/lib/PublicInbox/View.pm
index 8c81253..782e668 100644
--- a/lib/PublicInbox/View.pm
+++ b/lib/PublicInbox/View.pm
@@ -573,13 +573,18 @@ sub add_text_body {
 		$ctx->{-diff} = $diff = [];
 		my $spfx;
 		if ($ibx->{-repo_objs}) {
-			my $n_slash = $upfx =~ tr!/!/!;
-			if ($n_slash == 0) {
-				$spfx = '../';
-			} elsif ($n_slash == 1) {
-				$spfx = '';
-			} else { # nslash == 2
-				$spfx = '../../';
+			if (index($upfx, '//') >= 0) { # absolute URL (Atom feeds)
+				$spfx = $upfx;
+				$spfx =~ s!/([^/]*)/\z!/!;
+			} else {
+				my $n_slash = $upfx =~ tr!/!/!;
+				if ($n_slash == 0) {
+					$spfx = '../';
+				} elsif ($n_slash == 1) {
+					$spfx = '';
+				} else { # nslash == 2
+					$spfx = '../../';
+				}
 			}
 		}
 		$ctx->{-spfx} = $spfx;
-- 
EW


^ permalink raw reply related	[relevance 7%]

* [PATCH 0/4] viewvcs: Atom bugfix + diffstat anchors
@ 2019-02-01  8:55  6% Eric Wong
  2019-02-01  8:55  7% ` [PATCH 4/4] view: fix broken hunk header hrefs in Atom feeds Eric Wong
  0 siblings, 1 reply; 2+ results
From: Eric Wong @ 2019-02-01  8:55 UTC (permalink / raw)
  To: meta

Oops, I meant to email this out before
https://public-inbox.org/meta/20190201075030.23449-1-e@80x24.org/
("viewvcs: odds and ends"), but I forgot :x

diffstat anchors greatly aid in navigating large, multi-file
patches.  And I noticed Atom feeds were generating bad links
to solver :x

Eric Wong (4):
  hval: routines for attribute escaping
  viewdiff: diffstat links to diff anchors
  view: diffstat anchors for multi-message/attachment views
  view: fix broken hunk header hrefs in Atom feeds

 Documentation/design_www.txt     |  5 ++-
 lib/PublicInbox/Hval.pm          | 35 +++++++++++++++++++--
 lib/PublicInbox/View.pm          | 52 +++++++++++++++++++-----------
 lib/PublicInbox/ViewDiff.pm      | 54 ++++++++++++++++++++++++++------
 lib/PublicInbox/WwwAtomStream.pm |  2 +-
 t/hval.t                         | 14 +++++++--
 6 files changed, 127 insertions(+), 35 deletions(-)

-- 
EW


^ permalink raw reply	[relevance 6%]

Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-02-01  8:55  6% [PATCH 0/4] viewvcs: Atom bugfix + diffstat anchors Eric Wong
2019-02-01  8:55  7% ` [PATCH 4/4] view: fix broken hunk header hrefs in Atom feeds 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).