Serenity Operating System
at master 22 lines 631 B view raw
1function Link(el) 2 el.target = string.gsub(el.target, "file:///bin/.*", "/cant-run-application.html") 3 el.target = string.gsub(el.target, "help://man/([^/]*)/(.*)", "/man%1/%2.html") 4 return el 5end 6 7function Image(el) 8 -- Images that are not icons are always copied to the website root. 9 if el.src:find("^/res/icons/") == nil then 10 el.src = "/" .. el.src 11 return el 12 end 13 14 local pattern = "/res/icons/(.*)" 15 local image = string.gsub(el.src, pattern, "%1") 16 17 el.src = "/icons/" .. image 18 file = io.open("icons.txt", "a+") 19 file:write(image .. "\n") 20 file:close() 21 return el 22end