Skip to content

Commit

Permalink
fixing a bug in dealing with files with dots #948 -> patch release
Browse files Browse the repository at this point in the history
  • Loading branch information
tlienart committed Mar 7, 2022
1 parent bcfd1aa commit 3a85ea3
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Franklin"
uuid = "713c75ef-9fc9-4b05-94a9-213340da978e"
authors = ["Thibaut Lienart <[email protected]>"]
version = "0.10.70"
version = "0.10.71"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
1 change: 0 additions & 1 deletion src/converter/latex/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ function lx_figalt(lxc::LxCom, _)
alt = stent(lxc.braces[1])
path = parse_rpath(rpath; canonical=false, code=true)
fdir, fext = splitext(path)

# there are several cases
# A. a path with no extension --> guess extension
# B. a path with extension --> use that
Expand Down
5 changes: 4 additions & 1 deletion src/eval/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ function parse_rpath(rpath::AS; canonical::Bool=false, code::Bool=false)::AS
# here we want to remain unix-style, so we don't use joinpath
# note that rpath never starts with "/" so there's
# no doubling of "//"
rpath = unixify(splitext(loc_rpath)[1]) * rpath[3:end]
tmp = unixify(splitext(loc_rpath)[1])
rpath = ifelse(endswith(tmp, '/'), tmp, tmp * "/") * rpath[3:end]
return "/assets/" * rpath
else
full_path = joinpath(PATHS[:site], "assets",
Expand All @@ -114,10 +115,12 @@ function parse_rpath(rpath::AS; canonical::Bool=false, code::Bool=false)::AS
if code # recurse adding "./"
return parse_rpath("./code/" * rpath; canonical=canonical)
end

# otherwise, we consider the path as a full path relative to the
# /assets/ folder. For instance `blah/img1.png` => `/assets/blah/img1.png`
canonical || return "/assets/" * rpath # no doubling bc rpath[1] != '/'
full_path = joinpath(PATHS[:site], "assets", join_rpath(rpath))

return normpath(full_path)
end

Expand Down

0 comments on commit 3a85ea3

Please sign in to comment.