From 77fc1cb50395b1736301f292a7d3cb261a9fb43f Mon Sep 17 00:00:00 2001 From: marc lagrange Date: Tue, 10 Jun 2008 18:25:03 +0200 Subject: [PATCH] [awful] Add escape function Signed-off-by: Julien Danjou --- awful.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/awful.lua b/awful.lua index b39c84b7..283d5b1e 100644 --- a/awful.lua +++ b/awful.lua @@ -375,6 +375,15 @@ local function menu(p, textbox, exe_callback) end) end +local function escape(text) + text = text:gsub("&", "&") + text = text:gsub("<", "<") + text = text:gsub(">", ">") + text = text:gsub("\\", "'") + text = text:gsub("\"", """) + return text +end + -- Export tags function P.tag = { @@ -415,5 +424,6 @@ P.layout = } P.spawn = spawn P.menu = menu +P.escape = escape return P