Skip to content

Commit 122ff64

Browse files
StaticRocketpraneethbajjuri
authored andcommitted
fix(rename): relative paths should be from dir
Relative paths should be from the directory of the current file, not from the file itself. This was done correctly for 1 out of the 3 inline replacement filters. Signed-off-by: Randolph Sapp <[email protected]>
1 parent 4774189 commit 122ff64

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bin/rename.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def update_directives(**kwargs):
162162
"""Replace old include and image/figure statements"""
163163
ref_destination = (
164164
' '
165-
+ destination.relative_to(kwargs["file"], walk_up=True).as_posix()
165+
+ destination.relative_to(kwargs["file"].parent, walk_up=True).as_posix()
166166
+ "\n"
167167
)
168168

@@ -182,7 +182,7 @@ def update_inlines(**kwargs):
182182
ref_destination = (
183183
"`"
184184
+ destination.with_suffix("")
185-
.relative_to(kwargs["file"], walk_up=True)
185+
.relative_to(kwargs["file"].parent, walk_up=True)
186186
.as_posix()
187187
+ "`"
188188
)

0 commit comments

Comments
 (0)