From a250436d2944120f29e8c7e2372e628ffa73c316 Mon Sep 17 00:00:00 2001 From: "M. Liebmann" Date: Wed, 26 Feb 2014 10:02:38 +0100 Subject: [PATCH] CLuaInstance: Add DECODE_HTML flag to ctext.new for decode html string - Use function htmlEntityDecode() --- src/gui/luainstance.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/luainstance.cpp b/src/gui/luainstance.cpp index 046f783de..822de9c51 100644 --- a/src/gui/luainstance.cpp +++ b/src/gui/luainstance.cpp @@ -24,6 +24,7 @@ #include #include +#include #include #include #include @@ -1552,6 +1553,7 @@ int CLuaInstance::ComponentsTextNew(lua_State *L) { "ALIGN_TOP", CTextBox::TOP }, { "ALIGN_BOTTOM", CTextBox::BOTTOM }, { "ALIGN_NO_AUTO_LINEBREAK", CTextBox::NO_AUTO_LINEBREAK }, + { "DECODE_HTML", 0 }, { NULL, 0 } }; mode = 0; @@ -1559,6 +1561,8 @@ int CLuaInstance::ComponentsTextNew(lua_State *L) if (tmpMode.find(txt_align[i].name) != std::string::npos) mode |= txt_align[i].code; } + if (tmpMode.find("DECODE_HTML") != std::string::npos) + htmlEntityDecode(text); } CLuaComponentsText **udata = (CLuaComponentsText **) lua_newuserdata(L, sizeof(CLuaComponentsText *));