aboutsummaryrefslogtreecommitdiff
path: root/src/static/api.lua
blob: 3ca983064fba1ab11a8d21f0aa7cd7fbb5b4bd1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
local gitpad = {} -- gitpad namespace

function gitpad.html_escape(s)
    return (string.gsub(s, "[\"><'&]", {
        ["&"] = "&amp;",
        ["<"] = "&lt;",
        [">"] = "&gt;",
        ['"'] = "&quot;",
        ["'"] = "&#39;",
    }))
end

-- TODO: add API to build HTML tags

return gitpad