mirror of
https://github.com/kiwix/libkiwix.git
synced 2025-06-26 10:11:30 +00:00
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:
@ -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. */
|
||||
|
Reference in New Issue
Block a user