summaryrefslogtreecommitdiff
path: root/marigold.lua
diff options
context:
space:
mode:
authorsanine <sanine.not@pm.me>2022-08-15 16:19:46 -0500
committersanine <sanine.not@pm.me>2022-08-15 16:19:46 -0500
commit819d1ebb624c946f383bcea54f6b4363a1fa0153 (patch)
treeefeee89155abbf3811eb9e992d13f15ab9986e86 /marigold.lua
parentdf73dca1a539387a12da632f2dd48e34f08d70d0 (diff)
add marigold.percentDecode
Diffstat (limited to 'marigold.lua')
-rw-r--r--marigold.lua6
1 files changed, 6 insertions, 0 deletions
diff --git a/marigold.lua b/marigold.lua
index ac0e061..02c9bbe 100644
--- a/marigold.lua
+++ b/marigold.lua
@@ -121,5 +121,11 @@ marigold.html = function(tbl, indent_level)
indent, close)
end
+marigold.percentDecode = function(str)
+ return string.gsub(str, "%%(%x%x)", function(digits)
+ return string.char(tonumber(digits, 16))
+ end)
+end
+
return marigold