Files
dm-cli/dm-cli/cleanHtml.cpp
Vladimir N. Korotenko d49d8cac18 Статус сделки
2025-11-12 09:26:33 +03:00

28 lines
495 B
C++

#include "cleanHtml.h"
std::string cleanup_html(std::string const &encoded_string)
{
int start = encoded_string.find("<pre>") + 5;
int last = encoded_string.find("</pre>");
std::string ret;
ret = encoded_string.substr(start, last - start);
size_t b = 0;
for (int a = b; a < (int)(ret.length()); a++)
{
if (ret[a] == '<')
{
for (int b = a; b < (int)ret.length(); b++)
{
if (ret[b] == '>')
{
ret.erase(a, (b - a + 1));
break;
}
}
}
}
return ret;
}