From fd4a682c5bc2d4ec59daee9685b8fca21e02cf08 Mon Sep 17 00:00:00 2001 From: pagedown Date: Wed, 24 Aug 2022 13:29:51 +0800 Subject: [PATCH] Fix doc website URL with duplicate slashes --- kitty/conf/types.py | 2 +- kitty/constants.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/kitty/conf/types.py b/kitty/conf/types.py index 3a7a62955..5b89005df 100644 --- a/kitty/conf/types.py +++ b/kitty/conf/types.py @@ -109,7 +109,7 @@ def remove_markup(text: str) -> str: return f'{t} <{url}>' if m.group(1) == 'doc': t, q = extract(m) - return f'{t} <{website_url(q.lstrip("/"))}>' + return f'{t} <{website_url(q)}>' if m.group(1) in ('term', 'option'): t, _ = extract(m) return t diff --git a/kitty/constants.py b/kitty/constants.py index 521c22cf5..d1f9a2318 100644 --- a/kitty/constants.py +++ b/kitty/constants.py @@ -237,7 +237,7 @@ def website_url(doc_name: str = '', website: str = 'https://sw.kovidgoyal.net/ki if base: base += '/' doc_name = base + (f'#{frag}' if frag else '') - return website + doc_name + return website + doc_name.lstrip('/') handled_signals: Set[int] = set()