Merge pull request #7339 from tk0miya/3842_broken_images_when_singlehtml

Fix #3842: singlehtml: Path to images broken when master doc is not in source root
This commit is contained in:
Takeshi KOMIYA 2020-03-20 02:28:45 +09:00 committed by GitHub
commit 046b55b43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -127,6 +127,7 @@ Bugs fixed
* #7278: html search: Fix use of ``html_file_suffix`` instead of
``html_link_suffix`` in search results
* #7297: html theme: ``bizstyle`` does not support ``sidebarwidth``
* #3842: singlehtml: Path to images broken when master doc is not in source root
* #7179: std domain: Fix whitespaces are suppressed on referring GenericObject
* #7289: console: use bright colors instead of bold
* #1539: C, parse array types.

View File

@ -59,8 +59,8 @@ def relative_uri(base: str, to: str) -> str:
"""Return a relative URL from ``base`` to ``to``."""
if to.startswith(SEP):
return to
b2 = base.split(SEP)
t2 = to.split(SEP)
b2 = base.split('#')[0].split(SEP)
t2 = to.split('#')[0].split(SEP)
# remove common segments (except the last segment)
for x, y in zip(b2[:-1], t2[:-1]):
if x != y: