From ad0a7ed3a569db3f812686e1ab22445ea92d69da Mon Sep 17 00:00:00 2001 From: Frans de Jonge Date: Fri, 13 Mar 2020 12:13:15 +0100 Subject: [PATCH] [fix] Support proper local links (#5945) Only one style was supported. Fixes . See for discussion. --- frontend/apps/reader/modules/readerlink.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/apps/reader/modules/readerlink.lua b/frontend/apps/reader/modules/readerlink.lua index 26378f3b1..19940fea8 100644 --- a/frontend/apps/reader/modules/readerlink.lua +++ b/frontend/apps/reader/modules/readerlink.lua @@ -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("^(.-)(%?.*)$")