From 7bc9f30706793cded7736c193499a4cd960dcfae Mon Sep 17 00:00:00 2001 From: Thibaut Lienart Date: Sun, 24 Jan 2021 10:31:45 +0100 Subject: [PATCH] I768 (#769) * ensuring prepath gets applied properly for redirect pages * closes #768 --- Project.toml | 2 +- src/converter/html/functions.jl | 2 +- src/converter/html/link_fixer.jl | 2 +- src/manager/dir_utils.jl | 2 +- test/integration/hfuns.jl | 2 +- test/utils/folder_structure.jl | 5 +++++ 6 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Project.toml b/Project.toml index 9a3ee3367..256a5a9e8 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Franklin" uuid = "713c75ef-9fc9-4b05-94a9-213340da978e" authors = ["Thibaut Lienart "] -version = "0.10.25" +version = "0.10.26" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/converter/html/functions.jl b/src/converter/html/functions.jl index 40c51a82e..973b2f954 100644 --- a/src/converter/html/functions.jl +++ b/src/converter/html/functions.jl @@ -267,7 +267,7 @@ function hfun_redirect(params::Vector{String})::String - + """) diff --git a/src/converter/html/link_fixer.jl b/src/converter/html/link_fixer.jl index ea0543699..1942f3b12 100644 --- a/src/converter/html/link_fixer.jl +++ b/src/converter/html/link_fixer.jl @@ -79,5 +79,5 @@ function fix_links(pg::String)::String pp = strip(prepath, '/') ss = SubstitutionString("\\1=\"/$(pp)/") # replace things that look like href="/..." with href="/$prepath/..." - return replace(pg, r"(src|href|formaction|url)\s*?=\s*?\"\/" => ss) + return replace(pg, r"(src|href|formaction|url)\s*?=\s*?\"?\/" => ss) end diff --git a/src/manager/dir_utils.jl b/src/manager/dir_utils.jl index 4cef62ca3..032580ad4 100644 --- a/src/manager/dir_utils.jl +++ b/src/manager/dir_utils.jl @@ -53,7 +53,7 @@ function _out_path(base::String)::String # add a closing separator to folder path rbase = joinpath(path(:folder), "") * "_" - outpath = base[nextind(base, length(rbase)):end] + outpath = base[nextind(base, lastindex(rbase)):end] outpath = joinpath(path(:site), outpath) else # path is not a 'special folder' diff --git a/test/integration/hfuns.jl b/test/integration/hfuns.jl index f575973e4..e667e9f66 100644 --- a/test/integration/hfuns.jl +++ b/test/integration/hfuns.jl @@ -25,7 +25,7 @@ - + """ end diff --git a/test/utils/folder_structure.jl b/test/utils/folder_structure.jl index 635e93477..e20151460 100644 --- a/test/utils/folder_structure.jl +++ b/test/utils/folder_structure.jl @@ -47,6 +47,11 @@ end out = F.form_output_path(base, file, :md) @test out == joinpath(F.PATHS[:site], "menu", "page", "index.html") + # issue 768 + file = "pagéα.md" + out = F.form_output_path(base, file, :md) + @test out == joinpath(F.PATHS[:site], "menu", "pagéα", "index.html") + # OTHER STUFF file = "foo.css" base = F.PATHS[:css]