Skip to content

Commit

Permalink
Compat
Browse files Browse the repository at this point in the history
  • Loading branch information
jonludlam committed Aug 21, 2024
1 parent 10fbf04 commit c99abf0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/html/link.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,15 @@ module Path = struct

let remap config f =
let l = String.concat "/" f in
match
List.find_opt
try
let (prefix, replacement) = List.find
(fun (prefix, _replacement) -> Astring.String.is_prefix ~affix:prefix l)
(Config.remap config)
(Config.remap config) in
let len = String.length prefix in
let l = String.sub l len (String.length l - len) in
Some (replacement ^ l)
with
| None -> None
| Some (prefix, replacement) ->
let len = String.length prefix in
let l = String.sub l len (String.length l - len) in
Some (replacement ^ l)
| Not_found -> None

let get_dir_and_file ~config url =
let l = Url.Path.to_list url in
Expand Down

0 comments on commit c99abf0

Please sign in to comment.