ErrorLogger: Added better \n handling to the XML output
This commit is contained in:
parent
2e249670b3
commit
00dc3adc18
|
@ -128,7 +128,7 @@ std::string ErrorLogger::ErrorMessage::getXMLFooter()
|
|||
static std::string stringToXml(std::string s)
|
||||
{
|
||||
std::string::size_type pos = 0;
|
||||
while ((pos = s.find_first_of("<>&\"", pos)) != std::string::npos)
|
||||
while ((pos = s.find_first_of("<>&\"\n", pos)) != std::string::npos)
|
||||
{
|
||||
if (s[pos] == '<')
|
||||
s.insert(pos + 1, "<");
|
||||
|
@ -138,6 +138,8 @@ static std::string stringToXml(std::string s)
|
|||
s.insert(pos + 1, "&");
|
||||
else if (s[pos] == '"')
|
||||
s.insert(pos + 1, """);
|
||||
else if (s[pos] == '\n')
|
||||
s.insert(pos + 1, "
");
|
||||
s.erase(pos, 1);
|
||||
++pos;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue