add utf8.escape_xml and alias - string.escape_xml
This commit is contained in:
@@ -88,6 +88,11 @@ static int l_escape(lua::State* L) {
|
||||
return lua::pushstring(L, util::escape(string));
|
||||
}
|
||||
|
||||
static int l_escape_xml(lua::State* L) {
|
||||
auto string = lua::require_lstring(L, 1);
|
||||
return lua::pushstring(L, util::escape_xml(string));
|
||||
}
|
||||
|
||||
const luaL_Reg utf8lib[] = {
|
||||
{"tobytes", lua::wrap<l_tobytes>},
|
||||
{"tostring", lua::wrap<l_tostring>},
|
||||
@@ -98,5 +103,6 @@ const luaL_Reg utf8lib[] = {
|
||||
{"lower", lua::wrap<l_lower>},
|
||||
{"encode", lua::wrap<l_encode>},
|
||||
{"escape", lua::wrap<l_escape>},
|
||||
{"escape_xml", lua::wrap<l_escape_xml>},
|
||||
{nullptr, nullptr}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user