Skip to content

Commit

Permalink
Merge pull request #7339 from tk0miya/3842_broken_images_when_singlehtml
Browse files Browse the repository at this point in the history
Fix #3842: singlehtml: Path to images broken when master doc is not in source root
  • Loading branch information
tk0miya committed Mar 19, 2020
2 parents 457a0cc + 718b8f2 commit 046b55b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions sphinx/util/osutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 046b55b

Please sign in to comment.