Fix macro expansion: Now support } and/or }% to close a variable

This commit is contained in:
Felipe Zimmerle 2016-02-18 19:39:43 -03:00
parent f44143436b
commit 30d9ade192

View File

@ -62,7 +62,11 @@ std::string MacroExpansion::expand(const std::string& input,
variableValue = transaction->m_collections.resolveFirst(col, var);
}
res.erase(start, end - start + 2);
if (res[end - start + 2] == '%') {
res.erase(start, end - start + 1);
} else {
res.erase(start, end - start + 2);
}
if (variableValue != NULL) {
res.insert(start, *variableValue);
}