Skip to content

Commit

Permalink
Issue 1059: Fix downloadable abs path
Browse files Browse the repository at this point in the history
  • Loading branch information
Paldari committed Nov 6, 2024
1 parent 6c2d102 commit 5b8bdc3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sphinxcontrib/confluencebuilder/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ def find_env_abspath(env, out_dir, path: str) -> Path | None:
# configured source directory instead of an absolute path on the
# system -- check the environment's source directory first before
# checking the full system's path
if normalized_path.name[0] == os.sep:
new_path = Path(env.srcdir, normalized_path.name[1:])
if normalized_path.anchor == os.sep:
new_path = Path(env.srcdir, *normalized_path.parts[1:])

if new_path.is_file():
abs_path = new_path
Expand Down
Binary file not shown.
6 changes: 6 additions & 0 deletions tests/unit-tests/datasets/download/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ download
:download:`../../assets/example.pdf`

:download:`label<../../assets/example.pdf>`

:download:`files/example.pdf`

.. Absolute filename taken as relative to the top source directory
:download:`/files/example.pdf`

0 comments on commit 5b8bdc3

Please sign in to comment.