On Wed, Jun 17, 2026 at 12:47:04PM -0500, Nathan Bossart wrote:
> Oh, interesting.  I somehow hadn't noticed that in my testing.  I had a
> more invasive form of the patch that I think might improve matters.
> Double-checking...

The attached should resolve the issue without regressing build time.

-- 
nathan
>From 35799a190e8a43a78df7ce1ef3f53ebea97dffe0 Mon Sep 17 00:00:00 2001
From: Nathan Bossart <[email protected]>
Date: Wed, 17 Jun 2026 14:14:43 -0500
Subject: [PATCH v2 1/1] fix prev link, take 2

---
 doc/src/sgml/stylesheet-speedup-xhtml.xsl | 52 +++++++++++------------
 1 file changed, 26 insertions(+), 26 deletions(-)

diff --git a/doc/src/sgml/stylesheet-speedup-xhtml.xsl 
b/doc/src/sgml/stylesheet-speedup-xhtml.xsl
index a3b3692ba03..0700023c47b 100644
--- a/doc/src/sgml/stylesheet-speedup-xhtml.xsl
+++ b/doc/src/sgml/stylesheet-speedup-xhtml.xsl
@@ -183,32 +183,32 @@
   </xsl:if>
 
   <xsl:variable name="prev"
-    select="(preceding::book[1]
-             |preceding::preface[1]
-             |preceding::chapter[1]
-             |preceding::appendix[1]
-             |preceding::part[1]
-             |preceding::reference[1]
-             |preceding::refentry[1]
-             |preceding::colophon[1]
-             |preceding::article[1]
-             |preceding::topic[1]
-             |preceding::bibliography[parent::article or parent::book or 
parent::part][1]
-             |preceding::glossary[parent::article or parent::book or 
parent::part][1]
-             |preceding::index[$generate.index != 0]
-                               [parent::article or parent::book or 
parent::part][1]
-             |preceding::setindex[$generate.index != 0][1]
-             |ancestor::set
-             |ancestor::book[1]
-             |ancestor::preface[1]
-             |ancestor::chapter[1]
-             |ancestor::appendix[1]
-             |ancestor::part[1]
-             |ancestor::reference[1]
-             |ancestor::article[1]
-             |ancestor::topic[1]
-             |preceding::sect1[1]
-             |ancestor::sect1[1])[position()=last()]"/>
+    select="(preceding::*[self::book
+                          or self::preface
+                          or self::chapter
+                          or self::appendix
+                          or self::part
+                          or self::reference
+                          or self::refentry
+                          or self::colophon
+                          or self::article
+                          or self::topic
+                          or self::bibliography[parent::article or 
parent::book or parent::part]
+                          or self ::glossary[parent::article or parent::book 
or parent::part]
+                          or self::index[$generate.index != 0]
+                                        [parent::article or parent::book or 
parent::part]
+                          or self::setindex[$generate.index != 0]
+                          or self::sect1][1]
+             |ancestor::*[self::set
+                          or self::book
+                          or self::preface
+                          or self::chapter
+                          or self::appendix
+                          or self::part
+                          or self::reference
+                          or self::article
+                          or self::topic
+                          or self::sect1][1])[last()]"/>
 
   <xsl:variable name="next"
     select="(following::book[1]
-- 
2.50.1 (Apple Git-155)

Reply via email to