Merge branch 'jinja' into tool-call

This commit is contained in:
ochafik 2025-01-18 18:05:11 +00:00
commit c207fdcde6

View file

@ -1305,12 +1305,10 @@ struct ArgumentsExpression {
}; };
static std::string strip(const std::string & s) { static std::string strip(const std::string & s) {
static std::regex trailing_spaces_regex("^\\s+|\\s+$"); auto start = s.find_first_not_of(" \t\n\r");
return std::regex_replace(s, trailing_spaces_regex, ""); if (start == std::string::npos) return "";
// auto start = s.find_first_not_of(" \t\n\r"); auto end = s.find_last_not_of(" \t\n\r");
// if (start == std::string::npos) return ""; return s.substr(start, end - start + 1);
// auto end = s.find_last_not_of(" \t\n\r");
// return s.substr(start, end - start + 1);
} }
static std::string html_escape(const std::string & s) { static std::string html_escape(const std::string & s) {