Few more bugs fixed
This commit is contained in:
@@ -22,8 +22,19 @@ int32_t VNTextParser::onParse(
|
||||
struct VNText *out,
|
||||
std::string *error
|
||||
) {
|
||||
std::string innerXml = node->innerXml;
|
||||
|
||||
// Split by newlines, then trim each line.
|
||||
std::vector<std::string> lines = stringSplit(innerXml, "\n");
|
||||
std::vector<std::string> finalLines;
|
||||
for(auto it = lines.begin(); it != lines.end(); ++it) {
|
||||
auto newLine = stringTrim(*it);
|
||||
if(newLine.length() > 0) finalLines.push_back(newLine);
|
||||
}
|
||||
std::string finalXml = stringJoin(finalLines, "\n");
|
||||
|
||||
out->language = values["lang"];
|
||||
out->text = stringParser(node->innerXml, error);
|
||||
out->text = stringParser(finalXml, error);
|
||||
return error->length() == 0 ? 0 : -1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user