mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
[fix] Support proper local links (#5945)
Only one style was supported. Fixes <https://github.com/koreader/koreader/issues/5941>. See <https://github.com/koreader/koreader/issues/5941#issuecomment-598633973> for discussion.
This commit is contained in:
@@ -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("^(.-)(%?.*)$")
|
||||
|
||||
Reference in New Issue
Block a user