История изменений
Исправление zhuravlik, (текущая версия) :
local xml_entity_names = { [«'»] = «'», [«\»«] = »"", [«<»] = «<», [«>»] = «>», [«&»] = «&» };
--- Escape a string from XML char.
-- Useful to set raw text in textbox.
-- @param text Text to escape.
-- @return Escape text.
function util.escape(text)
return text and text:gsub(«['&<>\»]", xml_entity_names) or nil
end
// ну т.е. я хотел сказать, что и не переварит, ибо pango markup => xml => нужно эксейпить спецсимволы; это код awful.util.escape
Исходная версия zhuravlik, :
local xml_entity_names = { [«'»] = «'», [«\»«] = »"", [«<»] = «<», [«>»] = «>», [«&»] = «&» };
--- Escape a string from XML char.
-- Useful to set raw text in textbox.
-- @param text Text to escape.
-- @return Escape text.
function util.escape(text)
return text and text:gsub(«['&<>\»]", xml_entity_names) or nil
end