diff options
author | Martin Fischer <martin@push-f.com> | 2022-07-30 20:17:25 +0200 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-07-30 22:21:23 +0200 |
commit | 56c071bb832304ba9a2ec67215b1a8ae40723840 (patch) | |
tree | 2282e1f0eafcf65e807f2e9120617401b705d75c /src/static/api.lua | |
parent | a920436c3af249266ff907d15755c1291737905a (diff) |
implement lua scripting
Inspired by the Scribunto extension for MediaWiki.
Diffstat (limited to 'src/static/api.lua')
-rw-r--r-- | src/static/api.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/static/api.lua b/src/static/api.lua new file mode 100644 index 0000000..3ca9830 --- /dev/null +++ b/src/static/api.lua @@ -0,0 +1,15 @@ +local gitpad = {} -- gitpad namespace + +function gitpad.html_escape(s) + return (string.gsub(s, "[\"><'&]", { + ["&"] = "&", + ["<"] = "<", + [">"] = ">", + ['"'] = """, + ["'"] = "'", + })) +end + +-- TODO: add API to build HTML tags + +return gitpad |