We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6bfec7e commit 06f201aCopy full SHA for 06f201a
single_include/inja/inja.hpp
@@ -2127,7 +2127,11 @@ class Renderer : public NodeVisitor {
2127
if (value->is_string()) {
2128
std::string val;
2129
if (config.escape_strings) {
2130
+ // get the value as a dump() to properly escape values
2131
val = value->dump();
2132
+
2133
+ // strip the leading and trailing " characters that are added by dump()
2134
+ // if C++20 is adopted, val.starts_with and val.ends_with would clean this up a bit
2135
val = val.substr(0,1) == "\"" && val.substr(val.length()-1,1) == "\""
2136
? val.substr(1, val.length()-2)
2137
: val;
0 commit comments