fix: space Starlight's previous and next links

The word and the page title were split by a <br> only, which a copy,
textContent and an assistant read as "PreviousWhat the packs do not
hold". The override keeps Starlight's look, spaces them, names each link
by direction and page, and makes the pair a navigation landmark.
This commit is contained in:
Abdessamad Derraz committed 2026-11-11 10:27:53 +01:00
1 parent baa42df2a7
commit 8d69ad54df
4 files changed
+125 -4

No files matched your search

+2 -2
View File
@@ -396,7 +396,7 @@ class _Page(HTMLParser):
def handle_endtag(self, tag: str) -> None:
if tag == "nav" and self._crumbs:
self._crumbs = 0
if tag == "div" and self._pagination and not self.pagination:
if tag == "nav" and self._pagination and not self.pagination:
self._pagination = False
if self._text is not None and tag in ("a", "summary"):
self.sidebar.append(" ".join("".join(self._text).split()))
@@ -621,7 +621,7 @@ def _html(url: str) -> str:
def _pagination(text: str) -> tuple[str | None, str | None]:
start = text.find('<div class="pagination-links')
start = text.find('<nav class="pagination-links')
if start == -1:
return None, None
links = text[start:text.find("</footer>", start)]