Skip to content

Commit

Permalink
[fix] Support proper local links (#5945)
Browse files Browse the repository at this point in the history
Only one style was supported.

Fixes <#5941>.

See <#5941 (comment)> for discussion.
  • Loading branch information
Frenzie committed Mar 13, 2020
1 parent 27c3711 commit ad0a7ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion frontend/apps/reader/modules/readerlink.lua
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ function ReaderLink:onGotoLink(link, neglect_current_location, allow_footnote_po
end

-- Check if it is a link to a local file
local linked_filename = link_url:gsub("^file:", "") -- remove local file protocol if any
local linked_filename = link_url:gsub("^file:(//)?", "") -- remove local file protocol if any
local anchor
if linked_filename:find("?") then -- remove any query string (including any following anchor)
linked_filename, anchor = linked_filename:match("^(.-)(%?.*)$")
Expand Down

0 comments on commit ad0a7ed

Please sign in to comment.