mirror of https://github.com/kiwix/libkiwix.git
Exposed escapeForJSON() in kiwix namespace
Note that it is declared in stringTools.h but its definition remains in otherTools.cpp (to minimize the diff).
This commit is contained in:
parent
1553d52593
commit
f3d3ab13cb
|
@ -327,10 +327,7 @@ std::string kiwix::render_template(const std::string& template_str, kainjow::mus
|
|||
return ss.str();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
std::string escapeForJSON(const std::string& s)
|
||||
std::string kiwix::escapeForJSON(const std::string& s)
|
||||
{
|
||||
std::ostringstream oss;
|
||||
for (char c : s) {
|
||||
|
@ -345,6 +342,9 @@ std::string escapeForJSON(const std::string& s)
|
|||
return oss.str();
|
||||
}
|
||||
|
||||
namespace
|
||||
{
|
||||
|
||||
std::string makeFulltextSearchSuggestion(const std::string& lang,
|
||||
const std::string& queryString)
|
||||
{
|
||||
|
|
|
@ -53,6 +53,7 @@ private:
|
|||
const icu::Locale locale;
|
||||
};
|
||||
|
||||
std::string escapeForJSON(const std::string& s);
|
||||
|
||||
/* urlEncode() is the equivalent of JS encodeURIComponent(), with the only
|
||||
* difference that the slash (/) symbol is NOT encoded. */
|
||||
|
|
Loading…
Reference in New Issue