diff --git a/awful.lua b/awful.lua index b39c84b76..283d5b1e4 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