diff options
| -rwxr-xr-x | notYetAnotherWiki.lua | 9 |
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 |
