mirror of https://github.com/kiwix/libkiwix.git
makeFulltextSearchSuggestion() works via mustache
This commit is contained in:
parent
a18dd82d82
commit
c574735f51
|
@ -444,7 +444,13 @@ namespace
|
||||||
|
|
||||||
std::string makeFulltextSearchSuggestion(const std::string& queryString)
|
std::string makeFulltextSearchSuggestion(const std::string& queryString)
|
||||||
{
|
{
|
||||||
return "containing '" + queryString + "'...";
|
MustacheData data;
|
||||||
|
data.set("SEARCH_TERMS", queryString);
|
||||||
|
// NOTE: Search terms are **not** HTML-escaped at this point.
|
||||||
|
// NOTE: HTML-escaping is performed when the result of this function
|
||||||
|
// NOTE: is expanded into the suggestions.json template
|
||||||
|
const std::string tmpl("containing '{{{SEARCH_TERMS}}}'...");
|
||||||
|
return render_template(tmpl, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string noSuchBookErrorMsg(const std::string& bookName)
|
std::string noSuchBookErrorMsg(const std::string& bookName)
|
||||||
|
|
Loading…
Reference in New Issue