28 lines
495 B
C++
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;
|
|
} |