Repalced regex in URI::remove_newlines() with search & replace.
This commit is contained in:
parent
92f87fb85b
commit
c7165f7ffe
10
src/uri.cpp
10
src/uri.cpp
|
@ -505,7 +505,13 @@ const string URI::archive()
|
|||
return "";
|
||||
}
|
||||
|
||||
const string URI::remove_newlines(const string &text)
|
||||
const string URI::remove_newlines(string text)
|
||||
{
|
||||
return regex_replace(text, regex("\n"), " ");
|
||||
size_t pos = 0;
|
||||
while ((pos = text.find("\n", pos)) != std::string::npos)
|
||||
{
|
||||
text.replace(pos, 1, " ");
|
||||
++pos;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,8 @@ protected:
|
|||
//! Remove all HTML tags. If tag is not empty, remove tag and its content.
|
||||
const string remove_html_tags(const string &html, const string &tag = "");
|
||||
const string unescape_html(const string &html);
|
||||
const string remove_newlines(const string &text);
|
||||
//! Replace newlines with spaces.
|
||||
const string remove_newlines(string text);
|
||||
};
|
||||
|
||||
#endif // REMWHAREAD_URI_HPP
|
||||
|
|
Loading…
Reference in New Issue