[awful] Add escape function
Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
13a96b6edd
commit
77fc1cb503
10
awful.lua
10
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
|
||||
|
|
Loading…
Reference in New Issue