Fix handling of :doc: in CLI help output

This commit is contained in:
Kovid Goyal
2022-08-24 13:43:47 +05:30
parent 957eafbef0
commit 214416f1e3
5 changed files with 33 additions and 19 deletions

View File

@@ -1084,6 +1084,8 @@ def docs_url(which: str = '', local_docs_root: Optional[str] = '') -> str:
if frag.startswith('ref='):
ref = frag[4:]
which = resolve_ref(ref, lambda x: x)
if which.startswith('https://') or which.startswith('http://'):
return which
base, frag = which.partition('#')[::2]
base = base.strip('/')
if ld: