aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authoronefang2026-01-28 14:41:35 +1000
committeronefang2026-01-28 14:41:35 +1000
commit7c5365327d28445dadcdcb4a86a1b62494637faf (patch)
treef5e19ad50abc6c884b407b2d22d6b0596b9ee4d8
parentOops again. (diff)
downloadnotYetAnotherWiki-7c5365327d28445dadcdcb4a86a1b62494637faf.zip
notYetAnotherWiki-7c5365327d28445dadcdcb4a86a1b62494637faf.tar.gz
notYetAnotherWiki-7c5365327d28445dadcdcb4a86a1b62494637faf.tar.bz2
notYetAnotherWiki-7c5365327d28445dadcdcb4a86a1b62494637faf.tar.xz
Convert DocuWiki img linky.
-rwxr-xr-xnotYetAnotherWiki.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/notYetAnotherWiki.lua b/notYetAnotherWiki.lua
index fac1be2..a73107d 100755
--- a/notYetAnotherWiki.lua
+++ b/notYetAnotherWiki.lua
@@ -761,7 +761,7 @@ local lunaLinky = function(url) -- Fix up the links.
761 if '/System/' == url:sub(1, 8) then 761 if '/System/' == url:sub(1, 8) then
762 url = 'https://fos.wiki.devuan.org' .. url 762 url = 'https://fos.wiki.devuan.org' .. url
763 end 763 end
764 for i, p in ipairs{'https://wiki.devuan.org/?n=', 'https://wiki.devuan.org?n=', 'PmWiki/uploads/', 'Foswiki/pub/', 'https://fos.wiki.devuan.org/'} do 764 for i, p in ipairs{'https://wiki.devuan.org/?n=', 'https://wiki.devuan.org?n=', 'PmWiki/uploads/', 'Foswiki/pub/', '/', 'https://fos.wiki.devuan.org/'} do
765 if p == url:sub(1, #p) then 765 if p == url:sub(1, #p) then
766 local ur = url:sub(#p + 1) 766 local ur = url:sub(#p + 1)
767-- TODO - could probably replace some of this mess with RE.gsub() and friends. Meh, it works. 767-- TODO - could probably replace some of this mess with RE.gsub() and friends. Meh, it works.
@@ -798,6 +798,13 @@ local lunaLinky = function(url) -- Fix up the links.
798 url = '../../' .. p .. ur:gsub('%.', '.', 1) 798 url = '../../' .. p .. ur:gsub('%.', '.', 1)
799 elseif 'Foswiki/pub/' == p then 799 elseif 'Foswiki/pub/' == p then
800 url = '../../' .. p .. ur 800 url = '../../' .. p .. ur
801 -- TODO - Should check if this came from DocuWiki in the first place, AND double check this is for img src.
802 elseif '/' == p then
803 local cnt = 3
804 for j = 1, #p do
805 if '/' == p:sub(j, j) then cnt = cnt + 1 end
806 end
807 url = string.rep('../', cnt) .. 'DocuWiki/media' .. p .. ur
801 else 808 else
802 url = url .. '.HTML' 809 url = url .. '.HTML'
803 end 810 end